API Concepts of Java Swing

in #utopian-io6 years ago (edited)

What Will We Learn From This Tutorials?

in this tutorials, we learn full basic concept of java swing knowledge.
Java swing is one kind of window application based system to create it.. It works on AWT and API where written of java. So java swing is also part a JFC (java foundation class). Finally, java swing is one kind of platform where independent and light weight components.

• We will learn from this tutorial of full basic knowledge of java swing concept.
• Also know java swing components. Such as Java JButton, Java JLabel, Java JTextField, Java JTextArea, Java JPasswordField, Java JCheckBox, Java JRadioButton, Java JComboBox, Java JList, Java JTable, Java JOptionPane, Java JScrollBar, Java JMenuItem & JMenu, Java JPopupMenu, Java JCheckBoxMenuItem, Java JSeparator and also many more API components.

Requirements of this tutorials?

There are some requirements in this tutorials. such as-

• Basic knowledge of programming language means object oriented programming means java.
• Also need to know about AWT package.

Difficulty

In this tutorials it's no difficulty. Its totally easy tutorial.

• basic

Tutorial Contents of full package of java swing.

Java swing is a platform where is independent and also light weight components. It follows MVC pattern and also support pluggable look and it's also powerful components. So in this tutorials we discuss full package API components and also basic knowledge of Java swing.

Java JButton- Java JButton is one kind of class where used to crate a label button that has independent platform. This application means some action when button is pressed. And it's inherits abstract class of button.

So, we see the following example of JButton.

After running this program we can following these output-

Java JLabel- Java JLabel is one kind of component where we can write a plain text but we can't edit that text only text can display in a single line. JLabel inherits class of JComponents.

Here we can see the following example of JLabel-

After running this program we can following these output-

Java JTextField- Java JTextField is a class where component text can be edited in a single line text. It's also inherits class of JTextComponents.

Here we can see the following example of JTextField-

After running this program we can following these output-

Java JTextArea- Java JTextArea is one kind of components where multi line display text. Also it can allow to multi line editing. It also inherit JTextComponent class.

Here we can see the following example of JTextArea-

After running this program we can following these output-

Java JPasswordField- Java JPasswordField is a text class where specially for password entry. It also edit in a single line text. Its inherits class of JTextField.

So, we see the following example of JPasswordField-

After running this program we can following these output-

Java JCheckBox- Java JCheckBox is mainly a class to create a checkbox. It usually for on or off. It inherits class of JToggleButton.

So, we see the following example of JCheckBox-

After running this program we can following these output-

Java JRadioButton- Java JRadioButton is mainly to used to create a radio button. This button is used for chosen option.

So, we see the following example of JRadioButton-

After running this program we can following these output-

Java JComboBox- Java JComboBox is a class to use to show popup menu. It means to show popup menu option for choose by user. It inherits class of JComponent.

So, we see the following example of JComboBox-

After running this program we can following these output-

Java JTable- Java JTable is a class which used to display data and also composed row, column.

So, we see the following example of JTable-

After running this program we can following these output-

Java JList- Java JList means to represent of list of text. User can choose this list text. Inherits class of JComponent.

So, we see the following example of JList-

After running this program we can following these output-

Java JOptionPane- Java JOptionPane is used to show a dialog message for the display information. Inherits class of JComponent.

So, we see the following example of JoptionPane-

After running this program we can following these output-


Java JScrollBar- Java JScrollBar is a class used for scrollbar add horizontal, vertical. Inherits class of JComponent.

So, we see the following example of JScrollBar-
(
After running this program we can following these output-

Java JMenuItem & JMenu- Java JMenu is a class where used to pull down menu component which is display. And JMenuItem is a sub class where added menu label.

So, we see the following example of JMenuItem & JMenu-

After running this program we can following these output-

Java JPopupMenu- Java JPopupMenu is a usually use for dynamic popped within component.

So, we see the following example JPopupmenu-

After running this program we can following these output-

Java JCheckBoxMenuitem- JCheckboxmenuItem is a class used to check menu which is included. It can also used for select or not selected menu items.

So, we see the following example JCheckBoxMenuItem-

After running this program we can following these output-

Java JSeparator- Java JSeparator is a class which used for component to divided line for impenmenting. Inherits class of JComponent.

So, we see the following example JSeparator-

After running this program we can following these output-

Java JProgressBar- Java JProgressBar is a class which used to display the progress task. Inherits class of JComponent.

So, we see the following example JProgressBar-

After running this program we can following these output-

Java JTree- Java JTree is a class which used for display the structure of tree data. Its a complex component.Have a root node. Inherits class of JComponent.

So, we see the following example JTree-

After running this program we can following these output-

Java JColorChooser- Java JClassChooser is a class which used to create a dialog box of color chooser where user can select the color. Inherits class of JComoponent.

So, we see the following example JColorChooser-

After running this program we can following these output-


After click this button-

Java JTabbedPane- Java JTabbedPane is a class which used to switch group components by pressing on a tab. Inherits class of JComponent.

So, we see the following example JTabbedPane-

After running this program we can following these output-

Java JSlider- Java JSlider is a class which used to create the slider.

So, we see the following example JSlider-

After running this program we can following these output-

Java JSpinner- Java JSpinner is a class which used in a line that user can select an object from a order sequence.

So, we see the following example JSpinner-

After running this program we can following these output-


Java JDialog- Java JDialog is represent to control top level and also used user for some input. But its haven't maximize and minimize button.

So, we see the following example JDialog-

After running this program we can following these output-

Java JPanel- Java JPanel means to provide a space for application where can attach any component. Its a container simplest class. Inherits the class of JComponent.

So, we see the following example JPanel-

After running this program we can following these output-

Java JFileChooser- Java JFileChooser is a class which represent a dialog window where user can select any file. Inherits class of JComponent.

So, we see the following example JFileChooser-

After running this program we can following these output-


Java JToggleButton- Java JToggleButton which is used to create a new toggle button. Its mainly have two states button. such as on and off.

So, we see the following example JToggleButton-

After running this program we can following these output-




Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Bravo, It's seems that you are knowledgeable in that field good.

Your contribution cannot be approved because it does not follow the Utopian Rules, and is considered as plagiarism. Plagiarism is not allowed on Utopian, and posts that engage in plagiarism will be flagged and hidden forever.

You plagiarised your examples from https://www.javatpoint.com.

You can contact us on Discord.
[utopian-moderator]

Coin Marketplace

STEEM 0.18
TRX 0.13
JST 0.029
BTC 58157.69
ETH 3122.82
USDT 1.00
SBD 2.42