473,401 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

JRadioButton and ButtonGroup

17
Hi,
I have two radio buttons, b1 and b2. Now these two are added to a button group g1. I also have a JButton called submit. Now when I press "submit" I want to print on the console using system.out.println, which of the radio buttons was clicked in the group?
I assume the code will be written in the actionPerformed() for the submit button.

Thanks
Mar 11 '08 #1
2 1420
BigDaddyLH
1,216 Expert 1GB
Post your best effort and ask a specific question about it. have you studied the section in Sun's Swing tutorial on all the buttons?

http://java.sun.com/docs/books/tutor...ts/button.html
Mar 11 '08 #2
Bubbs
17
I think I figured out how to make this work. Had to change some logic. Thanks for the link.
Mar 11 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Caution | last post by:
Ok.. bare with me, not sure how to word this. I am writing a program that stores airplane data. My problem right now is trying to figure out how to get the navigation to work. My program loads...
1
by: klubbhead | last post by:
This part of my program needs to read from 4 parameter files and then displays them on the screen by clicking a different radio button. The program itself works, but my professor says that I have to...
0
by: Richie01 | last post by:
Ok, here i have the code for the form...but whenever i click update, delete or search all it does is close the form and nothing is done to the database. Could someone be kind enough to help me out...
2
by: vaani15 | last post by:
I am facing problem with appying the scroll bar. I have used JScrollPane, but its knob is nt functional. Can anybody help in how to use knob to see the image?? Also each time i use the scroll bar...
0
by: kjkrudh | last post by:
Hi, I have a problem. I am creating an order form in Netbeans 5.5.1 with Java. I need to clear the entire screen when the order is submitted (including the radio buttons' entry. I am told I need to...
0
by: dav3 | last post by:
For the current project I am working on I have a questionnaire of 7 questions. I currently have them in joptionpannels (i believe) but I would like to use radiobuttons due to the fact that most end...
2
by: karinmorena | last post by:
I'm having 4 errors, I'm very new at this and I would appreciate your input. The error I get is: Week5MortgageGUI.java:151:cannot find symbol symbol: method allInterest(double,double,double)...
5
by: xirowei | last post by:
public class Result { private int countA = 0; private int countB = 0; private int statement; private boolean statusA = false; private boolean statusB = false; private int arrayA = new...
7
by: meekstro | last post by:
I have been assigned to design an application that uses tabbed panes for different catagories and collects information bout size and quantity. Also it is suppose to display the cost of the order as...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.