-
Notifications
You must be signed in to change notification settings - Fork 32
OButton
lcaron edited this page Jul 7, 2015
·
1 revision
Customized buttons to replace the native Button widget.
Just replace Button by OButton :
final OButton button1 = new OButton(shell, SWT.PUSH);
button1.setText("Normal button");
button1.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
button1.setButtonRenderer(renderer);
final OButton button2 = new OButton(shell, SWT.PUSH);
button2.setText("Text & image");
button2.setImage(icon);
button2.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
button2.setButtonRenderer(renderer);
And voilà !
You can customize your buttons: selection image, image when not selected or disabled, font color, size...
An example called OButtonSnippet.java is located in the directory src/test/java/org/mihalis/opal/obutton.
This example is also available here :