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
votes
2 answers

Set selected item in jradiobutton to multiple

I have a JRadioButton and I have to set the selected item into 12, then after that it will disable/grey out the other selections if it already reaches into 12. All I know is that if you add the JRadioButton into the ButtonGroup, that will set the…
pep
  • 43
  • 6
-1
votes
1 answer

Dynamically creating jradiobuttons for each jlabel

What my program does is allow the user to select from a list of movies and decide whether they want to rent or purchase each movie. Here is my code: public void addMovie(JFrame framePassed, JLabel moviePassed, JCheckBox movieCheckBoxPassed){ …
K-Rob
  • 11
  • 3
-1
votes
1 answer

I do not understand why this code won't work(new to JRadioButtons)

I am learning JRadioButtons and I do not know why it is working in the tutorial I am watching and not in my code. Could someone please take a look at it? Main Class: import java.awt.*; import javax.swing.*; public class Calculator extends JPanel{ …
-1
votes
1 answer

JRadioButton in Graphic2D

I want to draw radiobuttons panel in Graphic2D but I don't know how can I do this. @Override public void draw(Graphics2D g2) { // ... Here I draw some Recntangle2D objects.... } And here is simple jbuttonpanel with radio…
ullQuiorra
  • 31
  • 1
  • 6
-1
votes
2 answers

how to get JRadioButton text value

male_btn = new JRadioButton("Male"); fmale_btn = new JRadioButton("Female"); btn_group = new ButtonGroup(); btn_group.add(male_btn); btn_group.add(fmale_btn); how to get JRadioButton value using button group.
A.K.
  • 2,284
  • 3
  • 26
  • 35
-1
votes
2 answers

How to wait for input from a group of JRadioButtons? (Java)

I have a class that is a JPanel and implements ActionListener. On the panel, there are three JRadioButtons, and when the user selects one of them, the user's score is incremented based on which radio button they selected. (This works- I tested it…
null
  • 11
  • 3
-1
votes
1 answer

How do I auto populate jRadioButtons with information?

I have been having an issue and I dont know how to solve it. In my code below you can see that I am trying to create a GUI that auto populates 20 jRadioButtons with the information provided, but when I run the program there are no buttons visible.…
Natester 13
  • 15
  • 1
  • 3
-1
votes
1 answer

Jradiobutton in multiple groups

I am attempting to have four jradiobuttons that are all connected. There are two teams that each have the option of left or right. A team should only have one of the options selected, while at the same time the team's should not have the same option…
Ian Pierce
  • 11
  • 1
-1
votes
2 answers

How to make JRadioButton transparent

I want to make the white circles of JRadioButtons transparent. How can I do that? setOpaque(false) only removes the background from text and not the circle.
Asalas77
  • 249
  • 5
  • 13
-1
votes
2 answers

how to check condition if 2 JRadiobutton was click?

i have small condition problem ,when i click a JRadiobutton it doesn't check the condition in if else statement and goes directly to else statement . this is my code i have do with the condition of if else and every thing is working Except the if…
user3447091
  • 1
  • 1
  • 2
-1
votes
2 answers

different output according to radio button selection

My issue is that I do not know how to check whether or not a radio button is selected, and then choose a different output according to which one i selected. Basically, as my code is right now, once a radiobutton is selected, it is selected forever,…
Jacob Stinson
  • 181
  • 1
  • 16
-1
votes
1 answer

Setting radio buttons to a background

I was trying to set Radio Button to a background in order to allow the user to select. Here is the code .. public class FirstWindow extends JFrame { private JTextField search; private JRadioButton author,title,both; private ButtonGroup…
-1
votes
1 answer

avoid boxlayout overlapping

Here I go again... battling with swings!!! So I'm creating an online test which will be displayed in an applet. The number of questions in the tests isn't fixed, so I need to ask questions according to the test. In order to display the questions I…
JLA
  • 329
  • 1
  • 6
  • 12
-1
votes
1 answer

JRadioButton clicked get value & compare

i´m a newbie to java my program has 4 JRadiobuttons (button1, button2, button3, button4) & 1 Button(b), when i clicked (b), random int show on 4 JRadioButton now i want to 1.****compare (by clicking b) the int(value) of button1, with the button2,…
-1
votes
4 answers

If-else condition within a JButton ActionEvent

I've just uploaded my progress into the program. Please have a look and see what is lacking in it. Also, please ignore the lame joke from the strings in it while you're at it. It can be downloaded from this link:…
dothackjhe
  • 29
  • 1
  • 2
  • 5
1 2 3
29
30