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

Radio buttons and setSelected or something else?

I have a JFrame form with labels, text fields, a combo box and a button group that has 2 radio buttons. In another form I have a JTable filled with data about students (student id, name...), and when I select a row from a table, the form opens and…
user2370759
  • 37
  • 1
  • 2
  • 6
0
votes
3 answers

How to consume JRadioButton select on mouse click doesn't seem to work

I'm creating a very simple class to override Swing JRadioButton which allows a user to set a field determining whether or not the radio button is selectable. public class SelectableRadio extends JRadioButton implements MouseListener private boolean…
jiveturkey
  • 2,484
  • 1
  • 23
  • 41
0
votes
2 answers

Check if JRadioButton is checked

I'm begining with Java and I'm having a simple problem, I wanna get wether my JCheckBox is selected or no. For this I know I have to use comboBox.isSelected(), but in the method I wanna use it, I cannot make reference to the object JCheckBox. Here's…
Agustín
  • 1,546
  • 7
  • 22
  • 41
0
votes
2 answers

How to set number of selectable JRadioButton

How would I go about setting the number of selectable items of JRadioButtons? I tried adding the radiobuttons to a buttongroup, and overriding the buttongroup class, but cant figure which method to modify. Basically, I want to allow selection of…
jp.
  • 1
  • 3
0
votes
3 answers

Action listener for multiple radio buttons

I intend to write a program where I will give the user a choice to choose from a 8*8 matrix. Because my reputation is below 10 I can not include an image but rest assured its just a normal 8*8 matrix. I plan to visualize it in my Java program with…
MD Yousuf Azad
  • 13
  • 1
  • 1
  • 5
0
votes
1 answer

Need jSpinner to be enabled from jRadioButton

I am working in a JTabbedPane inside of a JFrame. I have a jRadioButton that I need when selected to activate/enable two jSpinner controls that select date & time. I cannot find a reference for how this should be completed and this is not a school…
user2497501
0
votes
2 answers

how can i check line between two buttons?

How can I check a line which is drawn with the help of drawline function between two radio button any function which help me for checking line is exist between these buttons or not? import java.awt.*; import java.awt.event.ActionEvent; import…
0
votes
2 answers

Adding items to JtextArea and updating current balance

I am programming a GUI (Bank Account). I have done the necessary frames, but facing problems in adding information in the JTextArea. I have tried many different ways but still unsuccessful. When I select a radio button, for example "Savings or…
0
votes
2 answers

Adding a JPanel to an ActionListener

I have created a JPanel that has all the JRadioButtons on it that I need (it is called PortSettings). I also have a button, called port settings, when the user clicks the button, I need the JPanel to come up and display the radio buttons. I have…
Kendra Cheatham
  • 117
  • 5
  • 16
0
votes
3 answers

How to set the location of a JRadioButton?

I want to organize my buttons in a 3x3 box. Which layout should I use and how do I use it?
alexdr3437
  • 61
  • 2
  • 8
0
votes
2 answers

Java Button Handler

I am having an issue handling button events. I am creating a program that lets the user select the type of pizza they want and the program calculates the price of the pizza. I have my layout setup, however when a medium pizza is selected the button…
Mike
  • 19
  • 1
  • 4
0
votes
2 answers

JRadioButtons in a custom JScrollPane not appearing?

I'm writing an IM client GUI for a project. On the left of the window, I want a scrolling pane that has radio buttons for each active user, so that when a New Chat button is pushed, a chat will be created with the selected user. I've implemented a…
user2048643
  • 283
  • 1
  • 3
  • 14
0
votes
3 answers

How do I reset/clear JRadioButton in Java

How do you reset/clear a JRadiobutton? clearing a TextField is as simple as surenameField.setText(""); is there any similar way with the RadioButton?
user2263502
  • 13
  • 1
  • 1
  • 5
0
votes
1 answer

ENUM and radiobuttons Java

I have problems with enum and radiobuttons. I'm making a program where the user can choose different types of payments, the types are saved in class Type.java, see code: public enum Type { ENGANGSUTBETALING, FASTUTBETALING, ENGANGSINNBETALING,…
Michael
  • 56
  • 2
0
votes
1 answer

Why does my ButtonGroup give me an " expected" error?

I'm teaching myself about Java's swing components by creating a dialog box with three radio buttons, a text box and a "go" button. I've gotten to the point where I'm adding the Radio Buttons, and am running into an error with my code. I've got one…
dwwilson66
  • 6,806
  • 27
  • 72
  • 117