Results 1 to 1 of 1
- 05-25-2015, 09:50 PM #1
Member
- Join Date
- May 2015
- Posts
- 1
- Rep Power
- 0
How to create a Ticks Scale in SWT? I need a switch that "jumps", not "slides"...
Hi there.
I'm trying to create a ticks scale in SWT, where you can choose between 5 levels. Something similar to this:
(Ignore the volume label)
Where you can jump the switch from one level to another (but not in between levels).
The closest thing I could come is with is this:
Java Code:public class Gui { public static void main(String[] args) { Gui g = new Gui(); g.run(); } private Shell shell; private Display display; public Gui() { display = new Display(); shell = new Shell(display); shell.setSize(250, 250); // Scale Scale levels_scale = new Scale(shell, SWT.BALLOON | SWT.CENTER); levels_scale.setMinimum(1); levels_scale.setMaximum(5); levels_scale.setSelection(5); levels_scale.setIncrement(1); levels_scale.setPageIncrement(5); levels_scale.setSize(150,50); } public void run() { shell.open(); // Set up the event loop. while (!shell.isDisposed()) { if (!display.readAndDispatch()) { // If no more entries in the event queue display.sleep(); } } display.dispose(); } }
Actually you can't see it from the picture, but the slider slides smoothly from right to left and vice versa, instead of "jumping" from level to level.
In other words, I want a "jumper", and all I could find is "slider".
Can it be done, or this is the only option offered by SWT?
Any help would be greatly appreciated!
Thanks in advance.
Similar Threads
-
access denied("java.net.SocketPermission" "127.0.0.1:1099" "connect,resolve")
By klspepper in forum New To JavaReplies: 0Last Post: 12-07-2012, 09:29 AM -
Convert string operation symbols "+", "-", "/", "*" etc.
By Googol in forum New To JavaReplies: 3Last Post: 10-30-2012, 04:06 PM -
loop "play again" in an 8 ball game , loops but wont let me answer my "out.print"
By IareSmart in forum New To JavaReplies: 1Last Post: 02-01-2012, 09:37 PM -
MoneyOut.println("It took you (whats wrong?>",year,"<WW?) years to repay the loan")
By soc86 in forum New To JavaReplies: 2Last Post: 01-24-2009, 07:56 PM -
the dollar sign "$", prints like any other normal char in java like "a" or "*" ?
By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 08:35 AM
Bookmarks