Gwt-ext is a powerful Web development control library based on Google Web Toolkit (GWT) and ExtJs. It is ideal for fast development of rich Internet applications in the pure Java language. This series of articles will detail the basic structure and features of Gwt-ext, and demonstrate the implementation of the technology through code examples.
Layout Layout
(1) Horizontal layout
Horizontal layout causes all child objects in the parent container panel to be sorted sequentially along the same horizontal line.
The horizontal layout needs to implement the Com.gwtext.client.widgets.layout.HorizontalLayout class.
When the horizontal layout is set, the newly created child objects in the panel are displayed in the parent panel from left to right in the order in which they are added to the parent container. The following code Listing 1 produces the object layout as shown in Figure 1.
Listing 1. Horizontal layout
Panel.setlayout (New Horizontallayout (15));
Panel.add (new panel ("Item 1", 100, 150));
Panel.add (new panel ("Item 2", 75, 150));
Panel.add (new panel ("Item 3", 100, 150));
Panel.add (new panel ("Item 4", 150, 150));
Figure 1. Horizontal layout
(2) Vertical layout
The vertical layout causes all child objects in the parent container panel to be arranged vertically, sequentially.
The vertical layout needs to implement the Com.gwtext.client.widgets.layout.VerticalLayout class.