Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

how to create multible choices

Posted on 2004-04-10
6
181 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
hibernate example using maven 12 58
null output 3 35
Java Restore security prompts not working 10 61
printf performancy 11 70
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
The viewer will learn how to implement Singleton Design Pattern in Java.

837 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