Search code examples
javaswingjprogressbar

Vertical progress bar in swing?


I need a veritical progress bar in swing to display a temperature in one case and a voltage in another. How can I accomplish this?

Can I set the progress bar to a vertical mode?

Can I use the slider control in a read only mode in which it id not adjustable? I was thinking I could simply set the slider to the actual value when the user attempted to modify it but that seems clunky.

Any suggestions?


Solution

  • Per the Java tutorial, How to Use Progress Bars:

    JProgressBar(int)
    JProgressBar(int, int, int) - Create a progress bar with the specified orientation, which can be either JProgressBar.HORIZONTAL or JProgressBar.VERTICAL. The optional second and third arguments specify minimum and maximum values.