0

I have JAVA SWT/RCP application (Equinox OSGi), I am just creating Wizard which should look like one the picture:

enter image description here

The problem I just caught that standard SWT class Spinner, does not offer this kind of option to have some text inside of Spinner. I was doing some googling but I could not find any reasonable solution for this.

Spinner (with text) like described on my picture, is possible to do with Swing, but I cannot use Swing => SWT RCP (Equinox OSGi platform).

I even looked into SWT Spinner class source but its not very clear.

Can anybody help please?

To Kra
  • 3,344
  • 3
  • 38
  • 45

2 Answers2

2

I would suggest you to implement custom widget. If you look at Spinner, it is also a Composite. you could do the same, with a Text widget and up arrow Button and down arrow Button.

sambi reddy
  • 3,065
  • 1
  • 13
  • 10
  • It is not so simple, because those widgets are calling OS implementation... I looked into the code and its not very simple way. – To Kra Apr 22 '13 at 12:02
1

You could use an SWT Combo widget to simulate a Swing Spinner.

Here's some example code.

private String[] items = { "5 min", "3 min", "1 min" };

Combo readOnlyCombo = new Combo(shell, SWT.DROP_DOWN | SWT.READ_ONLY);
readOnlyCombo.setItems(items); 
Gilbert Le Blanc
  • 50,182
  • 6
  • 67
  • 111