Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+8 votes

An example of this can be creating a different looking slider or creating a knob that you can turn

asked in CSC 305 Fall 2024 by (253 points)

1 Answer

+4 votes

1) If you want custom functionality, you can create a custom component by subclassing an existing JavaFX component. There's an example of subclassing Label in section 3 of Chapter 13 of the textbook . You might be able to subclass Slider, or perhaps Canvas.

2) If you just want a slider with a different look/skin, some of that can be accomplished using CSS styling. e.g. https://www.youtube.com/watch?v=wK1eiX4LCCw (however, that wouldn't let you change it drastically, to make it a knob instead or something like that.)

3) Finally, let me note that making the software look like a radio is a low priority, and having a knob is probably less functional for the user than a slider, because turning a knob with the mouse isn't a natural interaction, whereas turning a physical knob with your fingers is natural.

answered by (2k points)
...