Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.eclipse.swt.*;
- import org.eclipse.swt.graphics.Rectangle;
- import org.eclipse.swt.widgets.*;
- public class Sash_test {
- public static void main (String [] args) {
- Display display = new Display ();
- Shell shell = new Shell (display);
- shell.setSize(400, 300);
- shell.setBackground(shell.getDisplay().getSystemColor(SWT.COLOR_BLACK));
- final Sash sash = new Sash (shell, SWT.BORDER | SWT.VERTICAL);
- sash.setBackground(shell.getDisplay().getSystemColor(SWT.COLOR_GREEN));
- Rectangle clientArea = shell.getClientArea ();
- sash.setBounds (180, clientArea.y, 32, clientArea.height);
- sash.addListener (SWT.Selection, new Listener () {
- public void handleEvent (Event e) {
- sash.setBounds (e.x, e.y, e.width, e.height);
- }
- });
- shell.open ();
- sash.setFocus ();
- while (!shell.isDisposed ()) {
- if (!display.readAndDispatch ()) display.sleep ();
- }
- display.dispose ();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment