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

get selected radio button list in swing

Im going to create multiple choice question application using java swing.I have created swing class with list of radio buttons inside separate jPanels.I need to find the selected radio button and make highlighted on correct answer when submit the…
Madura Harshana
  • 1,299
  • 8
  • 25
  • 40
5
votes
1 answer

Can I add JRadioButton into JTable

I tried to add JRadioButton into JTable by using CellEditor and CellRenderer, but I can't add JRadioButton into JTable. I am using NetBeans and backend MySQL. Please help me. Edit: Thank you, but I have no idea about how to group JRadioButton. Can…
Soorya Thomas
  • 391
  • 1
  • 8
  • 23
4
votes
2 answers

Changing Columns in JTable using JRadioButtons doesn't refresh structure

I've removed most of my GUI to keep the code short. I have a buttongroup of 3 JRadioButtons to select the table schema i want to display in my JTable, which is contained in a JScrollPane I have tried to use fireTableStructureChanged()…
Seve B.
  • 55
  • 1
  • 6
4
votes
1 answer

How to get dynamic RadioButton tooltip in Java?

I have a group of JRadioButtons. Each of them points to a directory with only text files, when I mouse over them they should count how many files are in each directory and return the file count as tooltips, I can not set the tooltips when I created…
Frank
  • 30,590
  • 58
  • 161
  • 244
4
votes
3 answers

JRadioButton border/padding/insets/margin... whatever you call it

In my Java app I am trying to create a very simple form with a label and a set of controls on each row of the form. Imagine something like this crude ASCII diagram: Result 1: (*) pass ( ) fail Result 2: ( ) pass (*) fail Error Count:…
John Kugelman
  • 349,597
  • 67
  • 533
  • 578
4
votes
4 answers

Which JRadioButton selected

I have several JRadioButtons in a ButtonGroup. private ButtonGroup radioGroup= new ButtonGroup(); private JRadioButton radio1= new JRadioButton("Red"); private JRadioButton radio2= new JRadioButton("Green"); private JRadioButton radio3=…
Evgenij Reznik
  • 17,916
  • 39
  • 104
  • 181
3
votes
2 answers

JRadioButton that looks like JButton

I'm trying to create a feature similar to that of Geogebra's toolbar: it has buttons that select tools, so only one can be selected at a time, but they don't look like radio buttons (a dot, with an inner dot if it's selected); they look like…
wchargin
  • 15,589
  • 12
  • 71
  • 110
3
votes
2 answers

How to increase size of JRadioButtons & JCheckBoxes?

I have a checklist with radio buttons and check boxes, I want to make the circles and boxes little bigger than their default size.
razshan
  • 1,128
  • 12
  • 41
  • 59
3
votes
1 answer

Change JCheckBox/JRadioButton selection color

Is there a way to change the selection color of a checkbox/radiobutton?
Vasyl
  • 1,393
  • 15
  • 26
3
votes
0 answers

How to calculate dimensions of a HTML formatted JComponent?

I am designing a Swing form using the GUI builder of Netbeans, and I'm using HTML to word wrap a JRadioButton. That works, but now the encapsulating JFrame does not resize the JFrame to fit the contents. I'm using the default GUI builder's…
MC Emperor
  • 22,334
  • 15
  • 80
  • 130
3
votes
1 answer

java swing radio buttons - java.lang.NullPointerException

I'm trying to get to grips with java swing and was testing out radio buttons. My code is: import java.awt.*; import javax.swing.*; import javax.swing.ButtonGroup; public class Scafhome extends javax.swing.JFrame { private JRadioButton…
curly
  • 39
  • 4
3
votes
1 answer

Why are my radiobuttons not mutually exclusive?

I am trying to implement two radiobuttons and make them mutually exclusive. public ProvincesPanel() { //radiobuttons definitions.csv this.setName("Provinces 2"); ButtonGroup vanillaOrMod = new ButtonGroup(); …
BURNS
  • 711
  • 1
  • 9
  • 20
3
votes
2 answers

how to use JRadioButton groups with a model

Is there any way to associate a group of JRadioButtons with a data model so it is easier to tell which button (if any) is selected? In an ideal world, I would like to associate a group of N radiobuttons with an enum class that has a NONE value and…
Jason S
  • 184,598
  • 164
  • 608
  • 970
3
votes
2 answers

How to set JRadioButtons vertically

i am working in java application that have many component but i have a problem with JRadioButton it's not in vertical way and is there any other way to make it vertical with out using JPanel and what is the best layout that i can use that make this…
isslam akkilah
  • 418
  • 1
  • 11
  • 23
3
votes
3 answers

Get value that been selected from radio button in java

import javax.swing.*; import java.awt.*; public class RadioButtonTest extends JFrame { private JTextField jtfAnswer = new JTextField(10); private JRadioButton jrbMale = new JRadioButton("Male"); private JRadioButton jrbFemale = new…
Adriel
  • 41
  • 1
  • 1
  • 3
1
2
3
29 30