0

I'm a student and still learning a lot about Java, but I have a pretty good grasp on the basics. Right now I am trying to figure out a way to recreate a radio button to mesh with the UI design for an application I have been commissioned to build.

The entire application is meant to be designed around the Star Trek LCARS interface (Bold bars, distinct color changes, no check boxes or radio buttons). I need to incorporate radio buttons into the design, but I have been unable to find any resource that will allow me to design a radio button without that distinctive filled/empty circle.

I already have a good idea of how I need to work the design. The selected item will change to a different display color with the mouse click or touchscreen tap. Selecting another item in the same group would deselect the original and select the new option, while trying to select the same item would unselect all choices (Select an undisplayed, "default option").

The problem is pure aesthetics, but it is important to the customer.

Is it possible to create a label (or other component) and have the ActionListener "transfer" the user interaction with the object to a radio button? In other words, the user clicks on the selection label and it fires off the same commands (change item/text color, play sound) and also fires off a command to set a designated radio button to either on or off?

Sergiy Medvynskyy
  • 11,160
  • 1
  • 32
  • 48

1 Answers1

1

well first of all... Everything is possible..its just a matter of how much time/effort you want to put in.

If I read that right..You have suggested creating a hidden radio button that gets information passed to it. This would work but is probably not the best way to design it.

I would personally just make an integer and call it mostRecentLabel or something to that effect and if you have 4 labels you would just keep track of which label was "turned on" with your mostRecentLabel variable. Then just put a function in that responds whenever a label is clicked to update your mostRecentLabel and this would update the display accordingly

Ben
  • 609
  • 11
  • 19
  • 1
    Good point. Using the hidden radio button is an option, but it would make updating the UI later a real pain, since there is a lot of dependancies between elements. The counter is a good suggestion. It's not a huge chunk of code, so I'll implement it. If I happen to find something that works better, then I still have a decent method to fall back on. – H Edward Nov 30 '14 at 18:32