Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how to create multible choices

Posted on 2004-04-10
6
Medium Priority
?
195 Views
Last Modified: 2010-03-31
Hello everyone out there, hope all is going well with you!

Is there a way to get a radio button,  or checkbox to be able to react like this. Example  5 checkboxs named 1-5 the actioncommand is set to be an audiofile. the user is creating a pattern of choices. 1,2,3,1,2,1,3,5,4,5,3,4,3,1,2 etc the radiobutton or checkbox will only have to be pressed once for each action to happen. Example button #1 is pressed and the audiofile goes into an arraylist #2 is pressed and the audiofile goes into an arraylist #1 is pressed again and the audiofile goes into an arraylist #2 is pressed again and the audiofile goes into an arraylist etc.
0
Comment
Question by:Drop_of_Rain
  • 3
  • 2
6 Comments
 
LVL 92

Expert Comment

by:objects
ID: 10795946
Sounds like they should be just buttons instead of checkboxes or radio buttons.
You just need to use an ActioListener to achoieve that behaviour and everytie it gets invoked add the audio to list.
0
 

Author Comment

by:Drop_of_Rain
ID: 10795984
Ok, how would a button be made about the size of a checkbox, there is a space limitation that is why I asked about radio buttons or checkboxs!
0
 
LVL 92

Accepted Solution

by:
objects earned 1600 total points
ID: 10796016
> how would a button be made about the size of a checkbox

try creating one without any text:

new JButton("");
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Expert Comment

by:Javatm
ID: 10796017
> Ok, how would a button be made about the size of a checkbox, there is a space limitation that is why I asked about radio buttons or checkboxs!

You could technically specify the layout like grid or card layout to fit or fill the required size of the buttons.

Hope that helps . . .
Javatm
0
 

Author Comment

by:Drop_of_Rain
ID: 10796099
Thanks for the support. That looks like it will wokout great.

Thanks to everyone
0
 
LVL 92

Expert Comment

by:objects
ID: 10796263
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question