Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Spinners?
Spinners? [message #452865] Fri, 25 March 2005 17:35 Go to next message
Andy Arhelger is currently offline Andy ArhelgerFriend
Messages: 62
Registered: July 2009
Member
I found a code snippet for spinners in cvs. But it doesn't compile. The
error says it can't find the class Spinner. This snippet seems to imply
Spinner is in org.eclipse.swt.widgets.* but I can't find it. What am I
missing?

import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;

public class Snippet184 {

public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
Spinner spinner = new Spinner (shell, SWT.BORDER);
spinner.setMinimum(0);
spinner.setMaximum(1000);
spinner.setSelection(500);
spinner.setIncrement(1);
spinner.setPageIncrement(100);
spinner.pack();
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}

Andy Arhelger
juggle@us.ibm.com
Re: Spinners? [message #452875 is a reply to message #452865] Fri, 25 March 2005 20:07 Go to previous messageGo to next message
R.J. Lorimer is currently offline R.J. LorimerFriend
Messages: 21
Registered: July 2009
Junior Member
What version of SWT are you using? Spinners were adding in the 3.1
timeframe.

Regards,

R.J.

Andy Arhelger wrote:
> I found a code snippet for spinners in cvs. But it doesn't compile. The
> error says it can't find the class Spinner. This snippet seems to imply
> Spinner is in org.eclipse.swt.widgets.* but I can't find it. What am I
> missing?
>
> import org.eclipse.swt.*;
> import org.eclipse.swt.widgets.*;
>
> public class Snippet184 {
>
> public static void main(String[] args) {
> Display display = new Display();
> Shell shell = new Shell(display);
> Spinner spinner = new Spinner (shell, SWT.BORDER);
> spinner.setMinimum(0);
> spinner.setMaximum(1000);
> spinner.setSelection(500);
> spinner.setIncrement(1);
> spinner.setPageIncrement(100);
> spinner.pack();
> shell.pack();
> shell.open();
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch())
> display.sleep();
> }
> display.dispose();
> }
> }
>
> Andy Arhelger
> juggle@us.ibm.com
Re: Spinners? [message #452880 is a reply to message #452875] Fri, 25 March 2005 22:35 Go to previous message
Andy Arhelger is currently offline Andy ArhelgerFriend
Messages: 62
Registered: July 2009
Member
Looks like version 3.0.1, which came with Rad 6.0.


R.J. Lorimer wrote:
> What version of SWT are you using? Spinners were adding in the 3.1
> timeframe.
>
> Regards,
>
> R.J.
>
> Andy Arhelger wrote:
>
>> I found a code snippet for spinners in cvs. But it doesn't compile.
>> The error says it can't find the class Spinner. This snippet seems to
>> imply Spinner is in org.eclipse.swt.widgets.* but I can't find it.
>> What am I missing?
>>
>> import org.eclipse.swt.*;
>> import org.eclipse.swt.widgets.*;
>>
>> public class Snippet184 {
>>
>> public static void main(String[] args) {
>> Display display = new Display();
>> Shell shell = new Shell(display);
>> Spinner spinner = new Spinner (shell, SWT.BORDER);
>> spinner.setMinimum(0);
>> spinner.setMaximum(1000);
>> spinner.setSelection(500);
>> spinner.setIncrement(1);
>> spinner.setPageIncrement(100);
>> spinner.pack();
>> shell.pack();
>> shell.open();
>> while (!shell.isDisposed()) {
>> if (!display.readAndDispatch())
>> display.sleep();
>> }
>> display.dispose();
>> }
>> }
>>
>> Andy Arhelger
>> juggle@us.ibm.com
Previous Topic:calling setFocus from a listener for activate event
Next Topic:Table row, column or item copy
Goto Forum:
  


Current Time: Fri Jul 19 14:59:55 GMT 2019

Powered by FUDForum. Page generated in 0.02554 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top