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
2
votes
1 answer

JRadioButton selection color

When any Radio Button in my Java UI program is selected, the selection is shown by a black dot. I want to make it Green. I'm using Java Swing. I followed the answer given to this SO Question , but it's not working for me. It still shows a black dot…
sanjeev mk
  • 4,276
  • 6
  • 44
  • 69
2
votes
1 answer

How to add JRadioButton to two columuns of a JTable and ButtonGroup them.

I want a JTable which consists of 2 columns(having RadioButton) Active and Inactive such that if Active Column is Selected then Inactive RadioButton gets Unselected and Vice versa means that in a single row only 1 radiobutton can be selected out…
user1760166
  • 89
  • 2
  • 8
2
votes
2 answers

Working with radio button in java

I've two jRadioButtons in Java application. Let's say Male and Female. Initially one is selected. While selecting another, the previous should be unselected and vice-versa. How to make it work? Also how can it be used to store in database?
Pradip Kharbuja
  • 3,442
  • 6
  • 29
  • 50
2
votes
2 answers

Vertical alignment of icons with various size in JRadioButtonMenuItem

I met problem to align icons of different sizes with JRadioButtonMenuItem. Here's a picture of my problem. The icons have several sizes and are left aligned. I would like to center the icons as in the picture below. Apparently, none of the methods…
paranoia25
  • 626
  • 1
  • 5
  • 23
2
votes
2 answers

How to catch user choice of jradiobutton in jpopupmenu?

I have been able to show a popup menu in my frame and the menu items, a group of radio buttons may be navigated with the arrow keys. When the user presses Enter/Return the popup menu is no longer visible and I assume that it is possible to determine…
Nate Lockwood
  • 3,325
  • 6
  • 28
  • 34
2
votes
2 answers

Error in adding radio buttons in a button group in Swing

I want to covert my code in AWT to Swing in Java. ButtonGroup group1=new ButtonGroup(); JRadioButton radio1=new JRadioButton("Brute Force Technique",true); JRadioButton radio2=new JRadioButton("Simulated Annealing Technique",false); …
Tapasweni Pathak
  • 552
  • 4
  • 7
  • 24
2
votes
0 answers

Code runs without errors but does not change label text

I have been working with this for a while now, and I can't get the text for the two JLabels to change on a click event. Any help would be very welcome. Thank you in advance. This is a GUI program with two radio button button groups that pulls input…
Brian
  • 55
  • 5
2
votes
1 answer

GUI changes with RadioButton Selection

Per the title, I'm trying to get my GUI change with RadioButton selection. More specifically, the JLabels and JTextfields. Essentially, I want to look something like this: http://i40.tinypic.com/262sec7.png, where the first three labels and fields…
1
vote
2 answers

I can't pin down the semantics for this JRadioButton functionality

I thought the best way to demonstrate this is with a compilable example. I want to have a group of radio buttons which behave as such (only one can be selected at a time); however, when the currently selected radio button is 'selected' again, the…
c24w
  • 7,421
  • 7
  • 39
  • 47
1
vote
2 answers

Java, how can I reset JTextField

I made a simple search gui method to search for products in DB and it works flawlessly. However, after the search is done I'd like to reset (JTextFields which are used to get parameters of search) to blank. Is there a method to do this without…
vedran
  • 2,167
  • 9
  • 29
  • 47
1
vote
2 answers

Radio button issue

So for this class in java, here is my code import java.awt.*; import java.awt.event.*; import java.util.Random; import javax.swing.*; import javax.swing.border.*; public class RadioSelection extends JFrame implements ActionListener { private…
1
vote
1 answer

Related to Auto-Update of JTable

I have two radiobuttons(Say rbtn_Asia,rbtn_Europe)and one JTable. When I select rbtn_Asia, table must contains Asia's data. Similarly when I select rbtn_Europe, table must contains Europe's data. (Asia's data and Europe's data is in same database…
svkvvenky
  • 1,122
  • 1
  • 15
  • 21
1
vote
1 answer

removing jRadioButton automatically in java

I have a set of JRadioButtons placed inside a JPanel. Also I have a "delete" button, such that if a JRadioButton is selected and then this "delete" button is pressed, the JRadioButton should be deleted from the JPanel. I tried this following (action…
infoSyStem
  • 145
  • 1
  • 2
  • 14
1
vote
2 answers

Why won't the second panel with the radio buttons show up?

We are not allowed to use IDE's in class this is being done in text pad. I am writing a traffic light program that when I click on the associated traffic light color it fills the color and makes it look like that light is active. I cannot currently…
Robert
  • 4,306
  • 11
  • 45
  • 95
1
vote
2 answers

Insert Radiobuttons in JTable Netbeans

I am populating Employee Data in JTable using Netbeans. I want to add Radiobutton in each row, so that user can select any row and can perform actions like Update/Delete,etc. Here is my code for TableModel: DefaultTableModel model = new…
Azeem
  • 2,904
  • 18
  • 54
  • 89