The JavaTM Tutorial
Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Trail: Creating a GUI with JFC/Swing
Lesson: Laying Out Components

Laying Out Components: Examples (1.1/1.2)

The table that follows lists every 1.1/1.2 example in the Laying Out Components lesson, with links to required files and to where each example is discussed.

Note: These examples use the Swing 1.1 API, which is supported by J2SE 1.2 and compatible releases, as well as JDK 1.1 + JFC/Swing 1.1. To see more up-to-date versions of these examples that can be launched using JavaTM Web Start, see the list of 1.4 examples (in the Creating a GUI with JFC/Swing trail).

Examples can run either as an application or as an applet unless noted otherwise. See Getting Started with Swing (in the Creating a GUI with JFC/Swing trail) for details about releases and instructions on compiling and running programs.

You can get the source, image, and other files required for all these examples by downloading the Tutorial Examples bundle (outside of the tutorial), which contains the files in the correct hierarchy. If you download an individual example, take care to have all the necessary files in the proper hierarchy when you compile and run it. For example, many examples expect their image files to be in a directory named images that's in the same directory as the example's class files.

Source Files Image & Other Files Where Described
AlignmentDemo.java (in a .java source file) (application only) geek-cght.gif middle.gif How to Use BoxLayout
BorderWindow.java (in a .java source file)
   AppletButton.java (in a .java source file)
To run the applet: BorderDemo.html
To view the <APPLET> tag: BorderDemo.atag
How to Use BorderLayout
BoxLayoutDemo.java (in a .java source file) (application only)
   BLDComponent.java (in a .java source file)
  How to Use BoxLayout
BoxWindow.java (in a .java source file)
   AppletButton.java (in a .java source file)
To run the applet: BoxDemo.html
To view the <APPLET> tag: BoxDemo.atag
How to Use BoxLayout
CardWindow.java (in a .java source file)
   AppletButton.java (in a .java source file)
To run the applet: CardDemo.html
To view the <APPLET> tag: CardDemo.atag
How to Use CardLayout
CustomWindow.java (in a .java source file)
   DiagonalLayout.java (in a .java source file)
   AppletButton.java (in a .java source file)
To run the applet: CustomDemo.html
To view the <APPLET> tag: CustomDemo.atag
How to Use CustomLayout
FlowWindow.java (in a .java source file)
   AppletButton.java (in a .java source file)
To run the applet: FlowDemo.html
To view the <APPLET> tag: FlowDemo.atag
How to Use FlowLayout
GridBagWindow.java (in a .java source file)
   AppletButton.java (in a .java source file)
To run the applet: GridBagDemo.html
To view the <APPLET> tag: GridBagDemo.atag
How to Use GridBagLayout
GridWindow.java (in a .java source file)
   AppletButton.java (in a .java source file)
To run the applet: GridDemo.html
To view the <APPLET> tag: GridDemo.atag
How to Use GridLayout
NoneWindow.java (in a .java source file)
   AppletButton.java (in a .java source file)
To run the applet: NoneDemo.html
To view the <APPLET> tag: NoneDemo.atag
Doing Without a Layout Manager (Absolute Positioning)
TabWindow.java (in a .java source file)
   AppletButton.java (in a .java source file)
To run the applet: TabDemo.html
To view the <APPLET> tag: TabDemo.atag
How to Use CardLayout


Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Copyright 1995-2003 Sun Microsystems, Inc. All rights reserved.