Popup Menu in Java Swing

A PopupMenu is a menu(which contains more than one menus) which is not visible until the user make a specific mouse action(right click).To create a popup menu we use the class JPopupMenu after that we can add menu items JMenuItem to a Popup Menu.

Input Dialog Box in Java Swing

An Input Dialog Box is used to accept data from the user. It appears with a component like TextField, ComboBox or List which lets the user to input the data. It is created by using the static method showInputDialog() of JOptionPane.

How to Use CardLayout in Java

The CardLayout manager is used to manage a large number of components. It organizes the components in layers which are arranged like a deck of cards sharing the same display area such only one of them is visible at a time. In order to use card layout, it is required to create an object of type JPanel that will hold the cards.

Timer and TimerTask in Java Swing

We use java.util.Timer for threads.This class provides schedule tasks for future execution in a background thread. We use java.util.TimerTask to set scheduled for one-time or repeated execution by a Timer.

How to Validate TextField in Java Swing

We can define a validation to validate user input for textfields, password fields etc.If the user entered value does not match the validation pattern, a message appears.

Page 4 of 12