L7-JFrame-Applets-OptionalPanel

L7-JFrame-Applets-OptionalPanel - CSE205 Concepts of...

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

View Full Document Right Arrow Icon
CSE205 Concepts of Computer Science and Data Structures
Background image of page 1

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

View Full DocumentRight Arrow Icon
GUI (Graphical User Interfaces) Introduction
Background image of page 2
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 3

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

View Full DocumentRight Arrow Icon
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 4
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 5

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

View Full DocumentRight Arrow Icon
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. 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 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 15

L7-JFrame-Applets-OptionalPanel - CSE205 Concepts of...

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

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