Java Tutorial

 
by Dinesh Thakur Category: Swing

We understand all upper menu structure of a graphical application that allows us to display a list of operations that in turn can contain other lists of operations. The basic structure consists of a menu JMenuBar (the top bar) from which dangle (JMenu) menus that we add elements (JMenuItem) that can be JCheckBoxMenuItem, and even JRadioButtonMenuItem JMenu. Consider now the methods of each of these classes:

 
by Dinesh Thakur Category: Swing
 
by Dinesh Thakur Category: Swing
 
by Dinesh Thakur Category: Swing

JListThe JList is a list on which we can view and select more than one item simultaneously. In case there are more items than can be simultaneously displayed due to the size of the list, a vertical scroll bar appears. Relevant methods:

 
by Dinesh Thakur Category: Swing

A layered pane is a Swing container which is used to hold the various components using the concept of layers. The components present in the upper layer overlaps the components present in the lower layer. The layered pane is created using the JLayeredPane class. the only constructor of this class is JLayeredPane ().

 
by Dinesh Thakur Category: Swing

A label is a simple control which is used to display text (non-editable) on the window. Since it does not possess any user interactive feature, it is considered as a passive control. A label is an object of

 
by Dinesh Thakur Category: Swing

Many of today's applications provide a facility wherein the users can open multiple documents without having to close current document. They can then switch between the documents and update them. For this purpose, applications use the multiple-document interface to manage these multiple open documents being processed in parallel (This is a main window, often called parent window, which contains several other windows, which also called child window.) JDesktopPane and JlnternalFrame classes of the Swing package help to create these multiple-document interfaces.

 
by Dinesh Thakur Category: Swing
 
by Dinesh Thakur Category: Swing
 
by Dinesh Thakur Category: Swing

Some operating systems have some special dialog boxes including selection to handle things like fonts, colors, printers and the like. Virtually all operating systems support the opening and storage of files, however, and thus the Java JFileChooser encapsulates this for easy use. JFileChooser, Opens a dialog box to ask for a filename.



 
by Dinesh Thakur Category: Swing
 
by Dinesh Thakur Category: Swing
 
by Dinesh Thakur Category: Swing
 
by Dinesh Thakur Category: Swing
 
by Dinesh Thakur Category: Swing

An input dialog box is used to accept data from the user. It appears with a component like text field, combo box or list which lets the user to input the data. It is created by using the static method

 
by Dinesh Thakur Category: Swing

showMessageDialog Displays a modal dialog with a button labeled "OK". It can be easily specify the message, icon, and title that will display the dialogue.

A message dialog box displays plain messages to the user and is created by using the static method showMessageDialog () of JOptionPane. The general form of showMessageDialog () method is:

 
by Dinesh Thakur Category: Swing

JDialog : Dialog boxes are JFrame restricted dependent on a main JFrame. The general JDialog dialog boxes are normally used for data requests.

 
by Dinesh Thakur Category: Swing

Displays a modal dialog with two buttons labeled "Yes" and "No".  These labels are not always terribly descriptive  program-specific actions that cause

 
by Dinesh Thakur Category: Swing
 


About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.