JFC and SWING - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

JFC and SWING

Description:

Swing provides three generally useful top-level container classes: JFrame, JDialog, and JApplet. ... has a content pane that, generally speaking, contains ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 9
Provided by: ayse7
Category:
Tags: jfc | swing | threepane

less

Transcript and Presenter's Notes

Title: JFC and SWING


1
JFC and SWING
  • JFC (Java Foundation Classes)
  • Swing GUI Components
  • Pluggable Look-and-Feel Support
  • Accessibility API
  • Java 2D API
  • Drag-and-Drop Support
  • Internationalization

2
Examples
  • Compile and run examples in
  • http//cse.yeditepe.edu.tr/taytekin/cse252/lab/la
    b5/ex.html

3
Some Events and Their Associated Event Listeners
4
Swing Components
  • A Visual Index to the Swing Components

5
Using Top Level Containers
  • Swing provides three generally useful top-level
    container classes JFrame, JDialog, and JApplet.
  • To appear onscreen, every GUI component must be
    part of a containment hierarchy. A containment
    hierarchy is a tree of components that has a
    top-level container as its root.
  • Each GUI component can be contained only once. If
    a component is already in a container and you try
    to add it to another container, the component
    will be removed from the first container and then
    added to the second.
  • Each top-level container has a content pane that,
    generally speaking, contains (directly or
    indirectly) the visible components in that
    top-level container's GUI.
  • You can optionally add a menu bar to a top-level
    container. The menu bar is by convention
    positioned within the top-level container, but
    outside the content pane.

6
Top Level Containers
Applet Panel
Frame
7
Frame Structure
8
Top Level Example
  • Compile and Run TopLevelDemo.java
  • http//java.sun.com/docs/books/tutorial/uiswing/co
    mponents/example-1dot4/TopLevelDemo.java
  • The containment hierarchy for this example's GUI
Write a Comment
User Comments (0)
About PowerShow.com