[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 197
  • Last Modified:

how to create multible choices

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
Drop_of_Rain
Asked:
Drop_of_Rain
  • 3
  • 2
1 Solution
 
objectsCommented:
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
 
Drop_of_RainAuthor Commented:
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
 
objectsCommented:
> how would a button be made about the size of a checkbox

try creating one without any text:

new JButton("");
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
JavatmCommented:
> 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
 
Drop_of_RainAuthor Commented:
Thanks for the support. That looks like it will wokout great.

Thanks to everyone
0
 
objectsCommented:
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now