Results 1 to 1 of 1
-
How to use vertical and horizontal sliders in SWT
Java Code:import org.eclipse.swt.SWT; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; /** * This class demonstrates Sliders */ public class SliderExample { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new GridLayout(1, false)); // Create a horizontal slider, accepting the defaults new Slider(shell, SWT.HORIZONTAL); // Create a vertical slider and set its properties Slider slider = new Slider(shell, SWT.VERTICAL); slider.setMinimum(0); slider.setMaximum(100); slider.setIncrement(5); slider.setPageIncrement(20); slider.setSelection(75); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); } }"The sole cause of man’s unhappiness is that he does not know how to stay quietly in his room." - Blaise Pascal
Similar Threads
-
Demonstrates how to draw vertical text in SWT
By Java Tip in forum SWTReplies: 0Last Post: 06-28-2008, 09:26 PM -
How to draw a VERTICAL BAR GRAPH in JAVA
By sacr83 in forum Java 2DReplies: 3Last Post: 04-30-2008, 08:09 AM -
what layout to use for vertical alignment?
By dim_ath in forum AWT / SwingReplies: 6Last Post: 01-20-2008, 05:28 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks