jlabel - Java Slider and ProgressBar -
I have two minor problems with a progress bar that I have connected to a slider in a Java frame. I am using NetBens I have added this code:
Private Zero jSlider1StateChanged (javax.swing.event.ChangeEvent evt) {JSlider Source = (JSlider) evt.getSource (); Int value = source.getValue (); JProgressBar1.setValue (value);}
-
As I moved the slider, progress progresses with the movement of the slider. However, it does not show any value in the slider. I think I am setting it up with the code above, but it only runs and no value is printed in progress. What's missing
-
This should be a simple simple question, shown below the label below my slider, when I set the minimum to min / max. When I set the minimum / maximum to 1 to 5, the label is shown 1 but 5 is not shown. What should I see from label 1 to 5 under the slider?
For your first problem, you can see the progress bar of your code progressBar.setStringPainted (true);
to show the specific values in the progress bar by adding the following line:
jProgressBar1 .setValue (value); JProgressBar1.setString (String.valueOf (value)); // This is a
Check JProgressBar for more information.
Comments
Post a Comment