gui1 - GUI (Graphical User Interfaces) Taking a user input...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
GUI (Graphical User Interfaces)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Taking a user input using a console (a user might enter an invalid input such as a number out of Range or a string containing non-digit characters): Taking a user input using Applet (a user is forced to choose among 0 through 7):
Background image of page 2
Making a Java program to generate a GUI is accomplished by using pre-defined classes in packages such as javax.swing and java.awt. Swing is a comprehensive solution to developing graphical use interfaces. There are more than 250 classes.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
GUI Class Hierarchy (Swing) Dimension Font FontMetrics Component Graphics Object Color Container Panel Applet Frame Dialog Window JComponent JApplet JFrame JDialog Swing Components in the javax.swing package Lightweight Heavyweight Classes in the java.awt package 1 LayoutManager *
Background image of page 4
JFrame, JApplet, and JDialog are heavy weight container classes that can be displayed alone and are used to contain other components. JFrame : the container that holds other Swing user-interface components in Java Graphical applications. It can be used in a Java program with a main method (Applications). JApplet : It is a subclass of the Applet class. Applet is defined in java.applet package and JApplet is defined in javax.swing package. You need to create a class that extends JApplet to create a Swing based Java applet. Such class will not contain a main method. Instead it contains applet purpose methods such as init(), start(), stop(), and destroy(). The applet will be displayed with a html file or appletviewer. (see appendix G in your book – pages825-840) JDialog/JOptionPane : a popup window or message box generally used as a temporary window to receive information from a user or provide notification that an event has occurred.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 12

gui1 - GUI (Graphical User Interfaces) Taking a user input...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online