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

Check which jRadioButtons have been selected if they have been created in a loop

I have a loop that creates rows, where each row has another loop to create 6 JRadioButtons. Only one JRadioButton can be selected from each row (as it should be), but I'm finding it difficult to use Action Listeners to check whether the correct…
AEkon
  • 119
  • 6
1
vote
4 answers

Need to make a variable within an action listener public

I am creating a GUI in which you first click on a radio button to define a variable, and then you click on a button. This button then tests for that variable and then performs two different actions depending on what the integer equals. My problem is…
1
vote
2 answers

Radio button doesn't change the state immediately

In our project my teammate notice unusual behavior for radio button, when inside action listener there is SwingUtilites.invokeLater call. Archetecture of the action listener doesn't allow to avoid this call because is designed to start another…
yu.pitomets
  • 1,660
  • 2
  • 17
  • 44
1
vote
1 answer

Can I add a JRadioButton for each value in an enum?

If I have the following enum: private enum Difficulty { EASY("Easy"), MEDIUM("Medium"), HARD("Hard"), EXTRA_HARD("Extra Hard"); public final String name; private Difficulty(String name) { this.name = name; …
DagdA
  • 484
  • 1
  • 7
  • 25
1
vote
1 answer

How should I use ActionItemListener on JRadiobutton?

I am trying to code very simple Java program - if the shape is fill and click on particular button is made than the message will popup. On the other hand, if the fill is not selected it will show different messages. fill.addItemListener(new…
Jahidul Islam
  • 29
  • 2
  • 7
1
vote
1 answer

JRadioButton is selecting the last one

my question is:- When i have multiple JRadioButtons it only selects the last one to be put into my database table. I have tried alot and i can't figure out why it only insets the last RadioButton. Even when i click a different button no matter what…
tharealdeal15
  • 17
  • 2
  • 5
1
vote
1 answer

How I can define a JRadioButton with large size?

I'm learning java. for my GUI program need to large radio buttons (larger than the standard). What can I do? I use Java Netbeans IDE - the latest version.
Saideh
  • 21
  • 3
1
vote
2 answers

How to set not editable JTable cells when JRadioButton is selected?

I have a JTable with some rows. How can i block edit row just when radiobutton unlock is selected? Below a small project to use as a working example Update ElencoPersoneFrame class package test; import java.awt.*; import java.util.*; import…
Raziel
  • 53
  • 1
  • 8
1
vote
2 answers

My JRadioButton change look with setOpaque(false)

I want to remove the background of my JRadioButton but still keeping the same look & feel. Images will speak by themselves: When I do this code: JRadioButton myJRadioButton = new JRadioButton("My JRadioButton"); add(myJRadioButton); I get…
MHogge
  • 5,408
  • 15
  • 61
  • 104
1
vote
1 answer

How to refresh JPanel when JRadioButton is select?

i have this class: public class TF extends JPanel implements ActionListener { private ButtonGroup buttonGroup = new ButtonGroup(); private JRadioButton rdbtnFilm; private JRadioButton rdbtnSerieTv; private JPanel pnlGeneral; …
Raziel
  • 53
  • 1
  • 8
1
vote
1 answer

JRadiobuttons combining JButtons implemetation. Error method not abstract and does not override abstract method

Am trying to implement a set of 3 JRadiobuttons that are detected using 3 ItemListeners and a set of 2 JButtons that are selected by 2 ActionListeners. When the "OK" JButton is pressed the current JRadioButton selection should be detected. I have…
TommyH
  • 23
  • 5
1
vote
1 answer

Setting the size of JPanel that contains JRadioButton

I have some problem , i want my jpanel to look like this but after codING i had this view and i didnt find the solution , i need some helps please. i put the radio button inside jScrollPan //listmateriel is a list (vector) of radio button…
Malek Djelassi
  • 85
  • 1
  • 10
1
vote
2 answers

Generate actionPerformed event for a buttom group

Is it possible to Generate actionPerformed event for a ButtonGroup of radio buttons in Java 7?. I can not find this option in NetBeans. I'm working with GUI Builder. Or any other form to develop this task? Right now I'm repeating code in all radio…
MauricioTL
  • 343
  • 1
  • 5
  • 17
1
vote
1 answer

How do you close JOptionPane after a radiobutton has been selected?

I am new to programming and just started last week, so all the java mumbojumbo is quite confusing to me. I was able to create a option pane for my BMI program that asks which unit system(metric/imperial) with radiobuttons and this determines which…
Adam
  • 433
  • 5
  • 9
1
vote
2 answers

How to enable a button only after a radio button was pressed in java JFrame

After a lot of googling i still haven't found what im looking for, mostly because i don't know what i'm looking for. Basically i want the lock in button to be disabled until one of the radio buttons is selected, and i only want one of the radio…
Kevin
  • 167
  • 1
  • 12