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

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

Laying Out Components: Examples


Note: The examples listed here can run either as an application or as an applet unless noted otherwise.

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