Do you think IIT Guwahati certified course can help you in your career?
No
Introduction
The VerticalPanel widget in GWT represents a panel that lays all of its widgets out in a single vertical row. This lays all of its widgets out in a single vertical column. This GWT Vertical Panel Widget can be used to create complex layouts with a single vertical row. Now let's see its class declaration along with other properties like class construction and methods.
A panel that lays all of its widgets out in a single vertical column.
Class Declaration
Declaration of com.google.gwt.user.client.ui.VerticalPanel class −
public class VerticalPanel
extends CellPanel
implements HasAlignment, InsertPanel.ForIsWidget
Nested Class Summary
GWT Vertical Panel Widget uses the different types of classes with specific purposes some of the nested classes are defined below
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasHorizontalAlignment
This method affect Elements: -# = the cell at the given index.
9
boolean remove(Widget w)
This removes a child widget.
GWT Vertical Panel Widget Methods Inherited
GWT vertical Panel Widget inherits the following methods
java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Panel
com.google.gwt.user.client.ui.ComplexPanel
com.google.gwt.user.client.ui.CellPanel
com.google.gwt.user.client.ui.VerticalPanel
GWT Vertical Panel Widget Example
In this example, we look for the usage of a vertical panel Widget in GWT in simple steps. Now let's have a look at the step-wise construction of the GWT Vertical Panel Widget.
Step 1: Create a project with the name VerticalpanelWidget under a package com.codingninjas.
Step 2: Change VerticalpanelWidget.gwt.xml, VerticalpanelWidget.css, VerticalpanelWidget.html and VerticalpanelWidget.java as explained below.
Step 3: Compile and run the application to get the output
Content of the modified module descriptor src/com.codingninjas/VerticalpanelWidget.gwt.xml.
<?xml version = "1.0" encoding = "UTF-8"?>
<module rename-to = 'VerticalpanelWidget'>
<inherits name = 'com.google.gwt.user.User'/>
<inherits name = 'com.google.gwt.user.theme.clean.Clean'/>
<entry-point class = 'com.codingninjas.client.VerticalpanelWidget'/>
<source path = 'client'/>
<source path = 'shared'/>
</module>
Content of the modified Style Sheet file war/VerticalpanelWidget.css.
Let us have the following content of the Java file src/com.codingninjas/VerticalpanelWidget.java, which will demonstrate the use of the VerticalPanel widget.
package com.codingninjas.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.DecoratorPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.RootPanel;
public class VerticalpanelWidget implements EntryPoint {
public void onModuleLoad() {
VerticalPanel verticalPanel = new VerticalPanel();
for (int i = 1; i <= 5; i++) {
CheckBox checkBox = new CheckBox("Element" + i);
verticalPanel.add(checkBox);
}
DecoratorPanel decoratorPanel = new DecoratorPanel();
decoratorPanel.add(verticalPanel);
/* Add the widgets to the root panel. */
RootPanel.get().add(decoratorPanel);
}
}
You can also try this code with Online Java Compiler
GWT (Google web toolkit) is an open-source development toolkit provided by google for developing browser-based, complex Ajax applications. We can even develop Rich Internet Applications (RIA) in Java using GWT, which will then be compiled into Javascript and cross-browser compliant.
What is GWT Vertical Panel Widget?
The VerticalPanel widget represents a panel that lays all of its widgets out in a single vertical row.This lays all of its widgets out in a single vertical column.
What characteristics does GWT have?
Asynchronous remote procedure calls, history management, bookmarking, UI abstraction, internationalization, and cross-browser portability.
Who uses GWT - Google Web Toolkit?
Companies like Crimsonlogic Pte. Ltd., StudyBlue Inc., and Intrado Inc. are using GWT.
How advantageous is learning GWT?
Many Google projects, both internal and external, are based on GWT, therefore, Google will need to sustain the technology as long as they need to keep improving the front-end.
Conclusion
In this article, we have extensively discussed how the project GWT Vertical Panel Widget. We have discussed its constructors, methods, and implementation. GWT Vertical Panel Widget is a part of form widgets that are used in many places while developing applications. and if you would like to learn more, check out our articles on