Solved

how to create multible choices

Posted on 2004-04-10
6
180 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 400 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

786 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