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

Netbeans java Swing jRadioButton setIcon and setSelectedIcon

I'm trying to set an Icon to my Radio Button. ImageIcon ImIcon= new ImageIcon("icons/star.ico"); //I have tried .png too jRadioButton1.setIcon(ImIcon); //or setSelectedIcon same resul The only result that I get is that the original RadioButton Icon…
0
votes
1 answer

Implementing JTree nodes with radio/check boxes

I'm trying to achieve an elegant tree representation in which certain types of nodes are displayed as panels containing text, a radio button, and a check box. Below is a picture of what I have currently and the code that generates it. However there…
ipetrik
  • 1,749
  • 18
  • 28
0
votes
2 answers

JComboBox and JButton Issues

I am having an issue with my JButtons and JComboBox I need to show a message if the user does not select a state then he gets a warning until he selects a state. But it keep screwing up and when it I do select a state it still tells to select a…
user4451158
0
votes
1 answer

Creating JRadioButton Matrix

I am creating a matrix of JRadioButtons (see image below). What I want to do is allow only one selection per row and column. Is there any way I can possibly assigned two button groups to a single button? Or is there any other suggestions how I may…
Sid78669
  • 85
  • 1
  • 9
0
votes
2 answers

How can I setSelected for a ButtonGroup where all its JRadioButtons were created in a loop?

I've got the following for loop creating JRadioButtons for the ButtonGroup btgrpDiff for each of the values in my Difficulty enum: private enum Difficulty { EASY("Easy"), MEDIUM("Medium"), HARD("Hard"), EXTRA_HARD("Extra Hard"); …
DagdA
  • 484
  • 1
  • 7
  • 25
0
votes
0 answers

on pressed event in radio button compare in form itself

private void DishFormWeekNoWeek1RbKeyTyped(java.awt.event.KeyEvent evt) { // TODO add your handling code here: char character = evt.getKeyChar(); …
Brownman Revival
  • 3,620
  • 9
  • 31
  • 69
0
votes
1 answer

multiple radio group give short cut key in keyboard for each radio button for each group java swing

I have radio many radio group in my application and each group has many radio button i want to know how it is possible to assign one key board short cut or a combination of keyboard short cut for each button for example i want to put number 1 in…
Brownman Revival
  • 3,620
  • 9
  • 31
  • 69
0
votes
1 answer

Fetch data in database into jradiobutton java

So far i can only get the question in my database table.It looks like this question in jtextfield. Example: Johnny's mother had three children.The first child was called April,the second child was called May.What was the third child's name? -…
0
votes
1 answer

How do i display the radiobutton and label in the same row?

private String[] gender = {"Male","Female"}; private JComboBox jco = new JComboBox(); private JRadioButton[] jrbGender; private ButtonGroup buttonGroup = new ButtonGroup(); private JButton jbtAdd = new JButton("Create"); private JButton…
user3718809
0
votes
2 answers

Displaying text from selected JRadioButton to JTextArea

I am working on my HOMEWORK (please don't do my work for me). I have 95% of it completed already. I am having trouble with this last bit though. I need to display the selected gender in the JTextArea. I must use the JRadioButton for gender…
Luis Ramos
  • 529
  • 1
  • 6
  • 13
0
votes
1 answer

How to get text from an instance of a radio button class created

This code runs but the new problem is that I am able to select more than one radio button in each section which is not supposed to happen. Also, it calculates the scores wrong. Please can someone help me fix it? Thank you!!! import…
M_Row
  • 109
  • 3
  • 12
0
votes
1 answer

Set selected JRadioButton using information from database

I'm currently creating a java swing app, where users can create a profile, specifically for this question's purpose, choose their gender. Here is the code: rbnMale = new JRadioButton("M"); rbnMale.setBorderPainted(false); …
user3763216
  • 489
  • 2
  • 10
  • 29
0
votes
2 answers

Determine which radiobutton is checked with javascript

Hi everyone can someone please help me with the following problem. // i have written the problem inside the javascript See http://jsfiddle.net/7Cmwc/3/ for example. function calculate() //If radiobutton with ID box3 is checked do this…
olzonpon
  • 73
  • 9
0
votes
1 answer

Printing jRadioButtons in jTextArea

I am having trouble figuring out how to add jRadioButton selections into my program. I am not sure if I am supposed to make a listener method or what because I have never created a listener and am a little confused on how to do so. My code is as…
Randy Gilman
  • 457
  • 1
  • 11
  • 21
0
votes
3 answers

How to allow 'one choice of many' controls?

I have a JFrame and in that frame I have some JCheckBox components. Say that I have two sets of 5 check boxes. I want to make it so that I check (for example) the first check box in the first set, the four others will be disabled. But not those in…
user3685412
  • 4,057
  • 3
  • 16
  • 16