Questions tagged [jradiobutton]

JRadioButton is the Java Swing implementation of a radio button.

JRadioButton is a Java implementation of a radio button -- an item that can be selected or deselected, and which displays its state to the user. Used with a ButtonGroup object to create a group of buttons in which only one button at a time can be selected.

Relevant tutorials:

445 questions
0
votes
1 answer

Creating custom JRadioButton with JtextField?

I want to make JTextField part of JRadioButton or hook them together. my intention is to let the user fill in the text field when he selects the radio button. For this reason I have created custom radio button which extends from JradioButton. I…
itro
  • 7,006
  • 27
  • 78
  • 121
0
votes
1 answer

I want my jRadioButtons to have a JOptionPane for quantity

I have a program consists of 15 jRadioButton which are phone products, jButton to calculate the total amount, and a purchase button. The program runs smooth and actually calculates the total sum of the selected radio buttons. The only thing that is…
0
votes
0 answers

How do I get a button to return a value?

I am writing a program to simulate voting districts for the electoral college. I am having trouble getting the logic to work to calculating the votes when the JRadioButton for a respective party is selected as well as printing the total votes for…
user3712626
  • 115
  • 1
  • 9
0
votes
1 answer

How to make jbutton sum up the values of my jradiobuttons

I'm making a project in jFrame. It has 15 jRadiobuttons. What I want is a jButton to add the selected jRadioButtons and display the sum in a jTextField. Can anyone help me? I've been doing this for 3 days and cant get it right.
0
votes
1 answer

Assistance needed with ClassCastException Exception handling and class creation

I have been hard at work revising my code, with the assistance of my peers here, and have come along ways. There are two issues I am facing that I would appreciate assistance on. First is within my MyListener class. Per previous tutorials and…
fox.josh
  • 185
  • 1
  • 8
0
votes
2 answers

Creating JradioButton as user adds more items

I want to have this part in my application which allows user to add more options (in form of JradioButton). So by default I give some options to user in JradioButton and if they add more options (on the other part of the application); my Jframe…
Hirad Gorgoroth
  • 389
  • 2
  • 4
  • 13
0
votes
1 answer

How to get the state of JRadioButtonMenuItem in another class?

I have a JRadioButtonMenuItem on my program that I can check in order to do some actions, so I need to get the state of this item (CHECKED or UNCHECKED). So when i try to get the state with isSelected() method in the same class where the…
0
votes
2 answers

Clean the window in swing

I have a group of jRadioButton that I created, each button has an action listener that creates a JTable in a separate window. I want that when I press another button, the frame will be cleaned and then the other JTable to be performed, ButtonGroup…
0
votes
1 answer

how to build a table of items and it's radioButtons with a dynamic size?

I want to build a table, with some items, and for each item I want to have its own radioButton. but the input is dynamic. so the size of the table is dynamic, and the "ActionCommand" for each radioButton is dynamic. what is the best way to do…
Atheel Massalha
  • 483
  • 1
  • 4
  • 10
0
votes
3 answers

How to set the Radio Button based on the value fetched from the database

I have a JTable filled with data about students (student id, name...), and when I select a row from a table, the form opens and its field need to be filled with same values (eg. if Johny Bravo was selected from the table. Then his name should be…
STEPHEN YAO
  • 105
  • 2
  • 2
  • 7
0
votes
2 answers

How can I enable/activate a radio button after a button is clicked?

Using a jFrame in Java and I have a set of radio buttons however I want these radio buttons to be activated once I have selected a certain button. What's the simplest way to do this? Thanks
Muzz
  • 1
  • 1
  • 3
0
votes
1 answer

ArrayList prints "5.0E-4%" instead of 0.0005

I have this button JRadioButton rdbtn1CE38 = new JRadioButton("> 100 %"); rdbtn1CE38.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { CE.set(37,0.0005); …
Vhalad
  • 119
  • 4
  • 14
0
votes
1 answer

JRadioButtons before every line

I have this program that reads questions with multiple choice answers from a text file and then displays a random set of them in a JOptionPane (very question in a new Pane). In my text file the questions and the 4 options of answers are all in one…
Pepka
  • 93
  • 1
  • 9
0
votes
0 answers

use JRadioButton to determine what Object to work with

I need to use two JRadioButtons (already set up the ButtonGroup) to determine which of two Objects will be worked with. savingsButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { …
dpooley
  • 1
  • 1
0
votes
1 answer

JOptionPane.showInputDialog and JOptionPane.showInputDialog Obligatory to respond

I'm doing a project to the university and I have a JOptionPane.showInputDialog that asks your name and another one that has 2 radio buttons. The thing is that I can leave it empty and the game continues. I wanted to stay still until you put a name…