

The tabs are represented by an index, which gets decided according to the place at or the position in which the tab was added. The user easily chooses which component he wants to see by choosing or clicking on the desired tab. In other words, the JTabbedPane helps you to have several components share the same place.

Here is an everyday example of such a window, that has several tabs that can be accessed by clicking on the tabs.Ī simple ‘properties’ window of a local disk (here, Local Disk F: Properties window on my system) on your computer system has multiple tabs, named General, Tools, Hardware, etc that you are able to access, by clicking on one of them, is a perfect example of the tabbed panes. The tabs can be given different titles or icons. It is very useful, as it provides the flexibility to the user to switch between different groups of components he desires to see, by simply clicking on one of the tabs. JTabbedPane is one of the classes provided by the swing package in java.
#ABSTRACT WINDOWS TOOLKIT HOW TO#
You also will learn how to create a scroll-able tab panel. You will be also able to set the position of your panel and frame.

At the end of this article, you will be able to add Swing JComponents like JTabbedPane onto an AWT Container. These components are comparatively light weighted too. They are written completely in java top of AWT, Abstract Windows Toolkit.īut opposite to AWT, Java Swing packages provide platform-independent components. Java Swing package is part of the Java’s foundation classes, JFCs.These foundation classes are used to create graphical user interfaces, window-based applications using available GUI components which makes easier for a programmer to develop desktop applications. JTabbedPane class is one of the many classes (such as JButton, JTextArea, JMenu, JTextField, etc)that ‘javax.swing’ java package provides for java swing APIs.
