The tab layout policy is either set to JTabbedPane.SCROLL_TAB_LAYOUT or JTabbedPane.WRAP_TAB_LAYOUT. This allows the programmer to control how the tabs will be displayed. It also lets the programmer decide the tab layout policy. This provides the privilege to decide the placement for the tab-pane the same as the JTabbedPane (int tabPlacement) constructor. JTabbedPane (int tabPlacement, int tabLayoutPolicy)Īn empty tabbed pane is created when this constructor is used. The placement is done when the direction is specified using JTabbedPane.TOP, JTabbedPane.BOTTOM, JTabbedPane.LEFT, or JTabbedPane.RIGHT. It provides the privilege to decide the direction or place for the pane. This constructor creates an empty TabbedPane. So the tab is placed on its default place that is TOP as discussed above using JTabbedPane.TOP. When we use the constructor JTabbedPane ( ), it creates the pane without any specification for its placement. The constructor JTabbedPane ( ) creates an empty TabbedPane. The commonly used constructors while using JTabbedPane are listed as follows: 1. While using JTabbedPane, we will be using its constructors too which are differentiated based on the privileges they provide. You can change this tab placement to any of the directions like LEFT, RIGHT or Bottom by the use of a method called, setTabPlacement method. the selected tab’s index.īy default, the tabs are placed at the TOP location, as you can see in the above window’s property tabbed pane. The Tabbed Pane classes use a single selection model that represents ‘a set of tab indexes’ as well as the ‘currently selected index’ i.e. Then its index will be equal to ‘0’ and your next tab will have an index equal to ‘1’ and going by the fashion, your last added tab’s index will be equal to ‘tab count minus 1’. To understand this, let’s suppose you added your first tab.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |