Skip to content

Instantly share code, notes, and snippets.

@Vaysman
Created June 17, 2015 00:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vaysman/4226e0da5f4ba65a8670 to your computer and use it in GitHub Desktop.
Save Vaysman/4226e0da5f4ba65a8670 to your computer and use it in GitHub Desktop.
package trash;
import javax.swing.*;
import java.awt.*;
public class JSliderDemo {
private JFrame frame = new JFrame("Slider");
private JSlider slider = new JSlider(1, 50, 1);
public JSliderDemo() {
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(new Dimension(100, 100));
frame.add(slider);
}
public static void main(String[] args) {
JSliderDemo sliderDemo = new JSliderDemo();
sliderDemo.start();
}
private void start() {
SwingUtilities.invokeLater(() -> frame.setVisible(true));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment