MouseListener Mouse event processing is easy to implement, we need to implement MouseListener interface and declare all the interface methods. We can attached the MouseListener to a widget with addMouseListener() method. "widget control".addMouseListener(new MouseListener() { public void mouseDown(MouseEvent e) { System.out.println("Mouse Down."); } public void mouseUp(MouseEvent e) { System.out.println("Mouse Up."); } public void mouseDoubleClick(MouseEvent e) […]

Read more SWT – MouseListener & MouseAdapter Example

What is TabFolder? In SWT, TabFolder is a subclass of a Composite class. The TabFolder can include composite object into a single container through a tabbed index. How to create a TabFolder? Here i create a TabFolder composite, add a sashForm composite into a tab 1 and Group composite into a tab 2. import org.eclipse.swt.SWT; […]

Read more SWT – TabFolder Example

What is SashForm? In SWT, SashForm is similar with Group, however it added one more useful feature, it’s allow user to adjust the control size at runtime environment. The SashForm provide this feature by creating a movable line between child widget (button, label, text…). When user drag the “line” it will expand one widget size […]

Read more SWT – SashForm Example

What is Group In SWT, Group is a subclass of a Composite class. Group is used to improve application appearance and make whole application look more organized. It will draw a rectangular border around all it’s child widgets. Group widget support five styles (actually it is nothing much different) 1) SWT.SHADOW_IN 2) SWT.SHADOW_OUT 3) SWT.SHADOW_NONE […]

Read more SWT – Group Example

In SWT, button widget consists of five buttons style. 1) Normal Button – SWT.PUSH 2) Arrow Button – SWT.ARROW 3) Toggle Button – SWT.TOGGLE 4) Check Box button – SWT.CHECK 5) Radio Button – SWT.RADIO Here i demonstrate how to create those buttons in SWT import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; public class […]

Read more SWT – Button Example

What is Label? The Label is the most common and frequent use widget, it’s display static information such as String or Image, and no user input involve. How to create a Label widget? This code snippet will create a label at position x=100, y=50, width = 300, height = 30, and display “I am Label” […]

Read more SWT – Label Example

SWT is stand for Standard Widget Toolkit. I do not want to explain what the benefits of it , please search Google for it. Please access SWT Official Website if you want to know more about it. Here is the simple SWT Hello World program import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; public class […]

Read more SWT Hello World Example