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

How to use Image in JRadioButtons instead of text

I have a group of JRadioButtons. I want to use image instead of text in my JRadioButtons. So I believe i will have to use this: JRadioButton(Icon icon, boolean selected) Now the issue is that I am not sure about how to create this icon. I have…
Sahil Chaudhary
  • 493
  • 2
  • 10
  • 29
1
vote
1 answer

JRadio Button Selection issue

I dont know if this is a silly issue that i am having or what but for the life of me i cant figure out the solution. I am writing a quiz program with 20 questions. The program asks each question and the user has 5 choices which are 5 JRadio Buttons…
rafaelzm2000
  • 133
  • 1
  • 4
  • 15
1
vote
1 answer

Use of image icons in java and implementing online/offline user (view)functionality with JRadio buttons

I think the question title is quite confusing(didn't find much words for the problem), I will try to explain the problem below. I want to include a feature similar to various chat applications. These applications have a feature to show the contacts…
me_digvijay
  • 5,374
  • 9
  • 46
  • 83
1
vote
3 answers

How do I clear the selection in a ButtonGroup such that no elements of the associated set of abstract buttons are selected?

I have created 5 radioButton group. I want user clear all group in one click. i use java 1.5. Does any one know how to do it? public void actionCommandCLEAR() { timeGroup.setSelected(timeGroup.getSelection(),false); …
itro
  • 7,006
  • 27
  • 78
  • 121
1
vote
3 answers

Swing: Resizing RadioButton

I need to implement font size switching in my app. But when I increase font's size RadioButtons remain same size and on small screen with high resolution my customer just can't hit it easily. Is there a way to resize RadioButton's round thing…
Aleksandr Kravets
  • 5,750
  • 7
  • 53
  • 72
1
vote
1 answer

Adding a JRadioButton to a Graphics Object

I have an existing graphics object, and I'm attempting to add a JRadioButton on top of it. Once the program is run, the button does not show up, and I think it's because there isn't a way to add a JPanel to a Graphics object. I add the…
davidVee
  • 61
  • 3
  • 13
1
vote
1 answer

Tab sequencing with JRadioButton

I am developing GUI in an application (which is based on Spring framework) using Swing. In one of the screens, we have several JButtons, JLabels, JFormattedtextFields and JRadioButtons in a panel. The question is: 1). When I press the tab button…
sonal
  • 101
  • 1
  • 4
  • 13
1
vote
3 answers

How to link a hotkey to a button in java?

I have four radio buttons and they're all part of a radioGroup. How can I link hotkeys to each of the buttons? What I want to do is link the keys '1', '2', '3' and '4' to each corresponding radiobutton. buttonGroup1 = new…
user1538070
  • 43
  • 1
  • 6
1
vote
2 answers

setting a default enabled radiobutton in a JTable

I used this guide in order to make JTable that would handle radio buttons. Works fine except i need to enable a default enabled button. there can be n rows. I've tried to enable it through the default table model, the Object[][], the table, and i…
Phox
  • 101
  • 1
  • 1
  • 10
1
vote
2 answers

Trouble with Java GUI design

I am having trouble designing GUI's in an object oriented manner. The following code will help me express my question more clearly: import javax.swing; import java.awt.*; import java.awt.event.*; public class QuoteOptionsPanel extends JPanel { …
1
vote
4 answers

How to add more then one radio button to form and how to connect two forms in java?

I am totally new to JAVA..i want to create a form with two Radio buttons on it,one for student and other for teacher. when the user clicks on student another form related to student should open and when user clicks on teacher,teachers form should…
user1390517
  • 249
  • 2
  • 10
  • 23
1
vote
3 answers

isSelected not returning true or false for JRadioButton

I have a program where I calculate for either 1 of 2 variables depending on the radio button selected. For some reason, isSelected() is not returning true or false. I will post my code below: import javax.swing.*; import java.awt.event.*; import…
Huy
  • 10,806
  • 13
  • 55
  • 99
1
vote
4 answers

I want to display a message showing what I selected (Java)

I'm doing a project (something like a restaurant) for collage, and I'm not very good in Java (they didn't really try to teach us). The principle of the project is to show a message saying what radio buttons and check boxes I've selected. I have 5…
Alejandra Uzelac
  • 647
  • 1
  • 7
  • 8
1
vote
2 answers

How to get the selected RadioButton from JTable

i'm workin on programe and i need to get the selected radio buttom from a Jtable I found an exemple that i'm workin on there is to class the 1st : import java.awt.Component; import java.awt.event.ItemEvent; import…
Adel Bachene
  • 974
  • 1
  • 14
  • 34
1
vote
2 answers

isSelected() does not recognize JRadioButton and JCheckBox are selected

I'm new here, and this is my very first post. I have a very specific need to code this very trivial application only invoking the isSelected() method to check whether or not a JRadioButton or JCheckBox have been selected. This means I do not want to…
A Java Bean
  • 101
  • 1
  • 7