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
1
vote
1 answer

How to add JRadio Button at run time

I am using Netbeans 7.1 and MySQL. I need 1 column in jtable which will contain jradiobutton and user can select any 1 row's jradiobutton Please refer the fig for detail. After selecting RB further processing will be done on jbutton click…
user2241865
  • 113
  • 4
  • 14
1
vote
1 answer

retrieving what swing radio button is selected from a group

User selects either the Admin radio button or the User radio button (2 of which are contained in a group). If admin radio button is selected the user is brought to the adminDashboard, else the user is brought to the userDashboard. I have been…
1
vote
1 answer

Invisible JRadioButtons

I have three different JRadioButtons that are all added to one JPanel. When I add the JPanel to the JFrame, only the lvl3 JRadioButton shows up. If I comment that line out, then none of the buttons show up. Is there something I'm doing wring? or…
1
vote
3 answers

WPF if statement based on radio button checked or not

I'm having difficulty with something which seems like it should be very simple. I'm coming from Windows Forms and starting up with WPF. I think I have a simple syntax issue but I can't seem to find a specific example for this radio button issue. I…
Nallware
  • 159
  • 1
  • 4
  • 18
1
vote
4 answers

Java Radio Button Variable Errors

So this works now, and i fixed the variable calling errors. but I get : Exception in thread "main" java.lang.NullPointerException at Radio.buildPanel(Radio.java:56) at Radio.(Radio.java:33) at Radio.main(Radio.java:74) My GUI Pops…
1
vote
1 answer

Adding ActionListener to JRadioButton & JComboBox

So what I am trying to achieve here is, if the first radio button and the first option from the first combobox is selected then I want to display the food under that category, if it is first radio button and the second option from the first combobox…
Ankur Sinha
  • 6,473
  • 7
  • 42
  • 73
1
vote
1 answer

Multiple Output Issue JRadioButton, default selection, else if, ActionListener

I am a new stack user and brand new to Java, so apologies in advance if this is in anyway unclear or the wrong terminology is used. I am looking to assign a base value if no selection occurs to a JRadioButton. i can set a JRadioButton to true which…
1
vote
3 answers

JRadionButton unselect automatically

I have a jframe that ontains two JRadioButton. public class jradioButtontest extends javax.swing.JFrame { public jradioButtontest() { initComponents(); } @SuppressWarnings("unchecked") //
Sajad
  • 2,273
  • 11
  • 49
  • 92
1
vote
1 answer

what do these swing color names mean

Some of the names are clear, like background, foreground, focus etc. But some are just confusing, like light, hightlight, shadow, darkshardow etc. I noticed that these are consistently used in swing UI, so I infer these are part of java's jargon. …
ShaggyInjun
  • 2,880
  • 2
  • 31
  • 52
1
vote
2 answers

Make a JRadioButton unclickable

I wonder if it is possible to make a JRadioButton unclickable? I have implemented some functions in an application, but i would still like to show the name of the functions yet to be implemented. The user chooses from a JRadioGroup so i'd like to…
gedemagt
  • 657
  • 1
  • 9
  • 22
1
vote
4 answers

How do I set the location of Radio Buttons?

I want to create two radio buttons for the "Gender" label. Here is what I got: maleRB = new JRadioButton("Male", true); femaleRB = new JRadioButton("Female", false); radioGroup = new…
Ciara
  • 197
  • 1
  • 3
  • 11
1
vote
2 answers

How to change the height of a radiobutton

I have a JTable in which 1 column contains 3 radiobuttons per cell mgrdData.getColumnModel().getColumn(intCol).setCellRenderer(new RadioButtonRenderer()); RadioButtonEditor butEdit = new RadioButtonEditor(new…
Hrqls
  • 2,944
  • 4
  • 34
  • 54
1
vote
4 answers

How to show that JRadio button is selected and deselected?

I have 5 JRadio buttons on my swing application. When I click my Jradio button. I have created a joption dialogue to display that it is clicked. But when I unselect it it also displays that it is selected. What is the problem? One of my Jradio…
Ameer
  • 600
  • 1
  • 12
  • 27
1
vote
3 answers

Issues with ItemListener attached to JComboBox

Please have a look at the following code import java.awt.event.*; import java.awt.*; import javax.swing.*; public class ComboIssue extends JFrame { private JRadioButton rOne, rTwo; private ButtonGroup group; …
PeakGen
  • 21,894
  • 86
  • 261
  • 463
1
vote
2 answers

can't set JPanel color and JRadioButton invisibility

I have problem with setting JPanel and JFrame color to white, though I used panel.setBackground(Color.white). The second problem is that setting ImageIcon in JRadioButton constructor causes that JRadioButton is invisible. Here is my code: public…
Kinga Garczyńska
  • 309
  • 1
  • 3
  • 6