In this section you will study how to create a Sash Form.
In SWT, the class SashForm lays out a Row or Column arrangement (as specified by the orientation) and places a Sash between them. In the given example, two sash forms are created. The first form is set to Horizontal and the second one is set to Vertical. Each containing a text and a label by using the class Text and Label. The form 1 is the parent of form2.
Following code can change the size of text and panel.
| text1.addControlListener(new ControlListener() { public void controlMoved(ControlEvent e) { } public void controlResized(ControlEvent e) { System.out.println("size changed"); } }); |
The label1 calls the MouseListener class. The method getMaximizedControl() returns the control that is currently maximized in the SashForm. The method setMaximizedControl(null) specifies the control that should be take up in the form.
Following code sets the form2 null, on double clicking the label1:
| form2.setMaximizedControl(null); |
Here is the code of SashFormExample.java
import org.eclipse.swt.SWT;
|
Output will be displayed as:

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Create a Sash Form
Post your Comment