Binding tabs with a hard URL
If we have an application that works with bigger UI groups, it's nice to separate them with tabs. For example, we want to show different screens for our Contractors, Customers, Employees, and Help pages. The following screenshot shows the initial page of our application. We can see that the Home screen corresponds to the URL.
And if the user clicks on another tab, the URL has changed.
How to do it...
Carry out the following steps to create tabs bound with the URL:
Create a project with the main UI class called, for example,
Demo
.public class Demo extends UI {…}
We create a
TabsURL
class that extendsTabSheet
.public class TabsURL extends TabSheet{…}
Now we create an array of UI group names.
private static final String tabNames[] = {"Home", "Contractors", "Customers", "Employees", "Help"};
We use these names for creating tabs. We insert the
createTabs()
method into ourTabsURL
class. Each tab contains a vertical layout with a big label according to the tab's name.private...