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);}  
  1. 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

  2. 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

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -