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
3 answers

JRadio button with information link

I want to have a set of JRadioButtons and next to each one a little 'i' image which when clicked will open a new window with information about the text next to the radio button. What is the best component to use to align the little 'i' label next to…
Aly
  • 15,865
  • 47
  • 119
  • 191
0
votes
1 answer

Can NetBeans 8.0 automatically change autogenerated Swing code?

I have two RadioButtons and this is the code that keeps getting set for them: jRadioButton6.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { …
Alexandru Cimpanu
  • 1,029
  • 2
  • 14
  • 38
0
votes
1 answer

JComponent, setEnabled() function only works properly the first time it is called

I have set up a JPanel which can be navigated to, away from, and then returned to any number of times. This JPanel has on it two JRadioButtons and has inside a JScrollPane containing a varying number of JComboBoxes. I have coded it so that when one…
James
  • 105
  • 3
  • 17
0
votes
3 answers

How to change list items of a combobox onclick of two different radio button

There is a private member in Page1.java which is combo box public class Page1 extends javax.swing.JInternalFrame { private javax.swing.JComboBox jComboMonth; public JComboBox getjComboMonth() { return jComboMonth; } …
0
votes
1 answer

How do I retrieve the component type used at a specific cell in a JTable?

I've created a JTable whose columns contain a variety of different components. The last five columns either contain nothing (a DefaultTableCellRenderer with no value) or a JRadioButton using a custom renderer and editor. The renderer creates and…
Duffluc
  • 27
  • 2
  • 6
0
votes
1 answer

how to edit a jlabel in different Jframe java?

I have this program in which I am trying to change the JLabel for each condition, but the problem is that the JLabel is in a different JFrame. For example, if the user select JRadioButton1 and JRadioButton2 I want a frame to open and Label named…
user3447091
  • 1
  • 1
  • 2
0
votes
2 answers

Changing JRadioButton Icon on Windows 7

I created a method which changes the icon of all jradiobuttons from a buttongroup: public void setRadioButtonIcons(final ButtonGroup gruppe){ Enumeration gruppeEnum = gruppe.getElements(); while…
M.R.
  • 1,959
  • 4
  • 24
  • 32
0
votes
1 answer

How can I organize my radio buttons on my JFrame?

In my code below, I couldn't organize my interface to look like the attached photo. I've tried grid and flow layouts, and I have been unable to solve the problem. package app; import javax.swing.*; import java.awt.*; …
0
votes
0 answers

how to count the number of radio buttons selected and display the score in the below code?

Some one please help me with this to display the score. I am new to programming. I want to make the score display in the message box. my problem is the scr variable do not get incremented. package QuizPackage; import javax.swing.*; import…
DINESH KUMAR
  • 121
  • 1
  • 1
  • 12
0
votes
1 answer

LinkedList and RadioButton

I have a LinkedList of all the selected answers of a user through radio buttons. I wish to set them as selected when revisited by picking up the earlier set answers in the LinkedList. How can this be achieved? selected=(String)…
Shrek_k
  • 3
  • 4
0
votes
1 answer

Trouble with java GUI. I can't get JRadioButtons to display in JLabel

I am new to Java; but I'm having a blast. I feel like I'm missing something really simple; but I can't figure it out. I want the RadioButtons to be displayed inside the JFrame." public class HelloWorldFrame extends JFrame { private…
0
votes
1 answer

Dynamically changing the title of a final JRadioButton

I'm having this problem where I can't figure out how to update the name of my JRadioButtons I've set them up in the contsructor like so: final JRadioButton ANSWER1 = new JRadioButton(answer1); with answer1 being a String. but whenever i change…
0
votes
1 answer

using .setText on final JRadioButton

How can I change the label of a JRadioButton when it is set as final? This is a section of code from the constructor where the radio buttons are initialised, when the check button is pressed, the selected radio button's value is sent to a method…
0
votes
3 answers

program not returning proper results for RadioButton

When I run the code below, the first 2 buttons do not appear; however, the third one is visible in the frame. public class RadioButton { RadioButton(){ JFrame frame = new JFrame(); JRadioButton button1 = new JRadioButton("One"); …
0
votes
1 answer

Changing the look of radio buttons

I tried googling it but i cant get past the million posts about unselecting radio buttons... Anyways, my problem is my radio buttons (all my buttons actually) look ugly: Is there any way to replace the background of them with this: ...or make…
Kevin
  • 167
  • 1
  • 12