Solved

how to create multible choices

Posted on 2004-04-10
6
182 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
Technology Partners: 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
difference of if loops 23 68
Opening PDF on button click and fill new document 2 53
Unhandled exception type Exception 18 52
printf performancy 11 83
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
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…

685 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