I'm quite the beginner regarding the whole drawing stuff in windows and I'm kinda stuck at the moment. At the moment I'm just testing the things out.
import javax.swing.*;
import java.awt.*;
import javax.swing.event.*;
public class test extends JFrame
{
JSlider slider1;
public test()
{
slider1 = new JSlider(JSlider.VERTICAL, 0, 50, 0);
setLayout(new FlowLayout(FlowLayout.TRAILING));
add(slider1);
}
public void changeValue ()
{
slider1.setValue(25);
}
public static void main(String args[]) {
test gui = new test();
gui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
gui.setSize(550,250);
gui.setVisible(true);
}
}
So I create a JSlider that I call slider1, I give it its orientation and values. When I call the changeValue method it obviously changes the slider1 value. But there's no change on the GUI. Could someone point me into the correct direction? Does it have something with refreshing the GUI?