0
votes

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?

2

2 Answers

2
votes

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.

1
votes

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);