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

Action Listener

The below code is an action listener for a project. Basically, I have 4 radio buttons and when I click one, I want it to change a variable on screen. When I run the code, it is simply adding together all the values. Are there any other ways to do…
Brandon
  • 161
  • 2
  • 4
  • 11
0
votes
1 answer

Swing : Transparent border's radio button when focus

I get stuck at remove border of radio button when i click on it ? can I do it ? thank in advance !
manhnt
  • 643
  • 1
  • 11
  • 24
0
votes
3 answers

Retrieving data from Radio Buttons

I need to retrieve data from radio buttons. Basically like this: String Gender = rdbtnM.getText(); My problem is, the user can select from one of 2 radio buttons: rdbtnM and rdbtnF. So the String Gender should have the value whatever has been…
user1210061
0
votes
1 answer

Adding a Circle Object to An Arraylist and displaying on Screen

This is my second semester doing Java and so please be patient. Part of my assignment is to click a Radio button and use the Circle's draw method to draw a Circle object on a Jpanel Content pane when the mouse button is clicked. Then store each…
handro
  • 85
  • 6
  • 13
0
votes
2 answers

Change a JPanel dynamically based on JRadioButton

I'm trying to change content dynamically based on a JRadioButton selection... My simplified code looks something like this. //import public class Thing { // JPanel pnlMain, pnl1, pnl2, pnlRt, pnlLt; JRadioBtn btn1, btn2; // Thing () { …
creXALBO
  • 307
  • 1
  • 3
  • 13
0
votes
1 answer

Embed a JComboBox inside a JRadioButtonMenuItem

I want to put a JComboBox inside a JRadioButtonMenuItem in a popup menu, is it possible ? How can it be done ? Thanks.
aleroot
  • 71,077
  • 30
  • 176
  • 213
0
votes
1 answer

radioButton does not show selected status

with the following snippet, the function of on/off is being achieved. however, the VISUAL does NOT display the radioButton as "selected". i am looking for help/direction in displaying the selected visual BEFORE the pause and clearing the combo (see…
0
votes
2 answers

Deselected JRadioButton

The code I'm creating involves a JRadioButton and a JComboBox. I want the JComboBox to be enabled if the JRadioButton is selected and disabled if it's not selected or deselected. My problem is that the JComboBox won't be disabled if I deselect the…
0
votes
2 answers

How to vertically align text and image above a JRadioButton?

Is it possible to align both the text and image above the JRadioButton icon? Edit - Well, apparently setting the icon in the constructor actually replaces the default JRadioButton icon, which I wasn't expecting. Looks like I may have to use two…
mre
  • 43,520
  • 33
  • 120
  • 170
0
votes
1 answer

How to get the value of lambda expression in asp .net mvc2?

I have a action result method where it gives values from the database and Iam passsing this values to the view and the values will be populated in the textboxes but i have radio button to be selected depending on the value of the database,example if…
user998594
  • 19
  • 5
0
votes
0 answers

How to use name attribute inside a dynamically rendered radio button component inside a map function

I want the radio button component inside every card to be completely independent. The issue i am facing is that I want to select one radio btn from the card per card. But When I select another one inside the same card it gets selected along with the…
toble
  • 1
  • 1
0
votes
2 answers

ActionListener not implemented

I was learning about JRadiobuttons and I made three JRadioButtons in this particular program. The JRadioButtons were pizzaButton, burgerButton and hotdogButton. I wanted to print specific lines when one of them is selected by the user. I overrided…
0
votes
1 answer

JRadioButton selection to String

I have a selection of JRadioButtons in a group. In this case they are contained in ButtonGroup "group". An example of a button would be reviewrequest = new JRadioButton("request for review"); etc. I am trying to convert the selected item into a…
Luki
  • 49
  • 6
0
votes
1 answer

Is there a way to select multiple check boxes in java?

I have been programming this small app that the user can select one of the a font colors, blue , red and black, so i used JradioButton for them. also the user can choose a style to the font whether bold or italic or both at the same time, so i used…
0
votes
1 answer

How to change one object's color while useing Flatlaf

This will change all the JRadioButton's checkmark color. UIManager.put( "CheckBox.icon.checkmarkColor", Color.red ); LookAndFeel lookAndFeel = UIManager.getLookAndFeel(); try { UIManager.setLookAndFeel( lookAndFeel ); } catch…
Alpha
  • 1
  • 1