Basic HTML version of Foils prepared Sept 21 1998

Foil 54 Some Further AWT Components: Window (Frame and Dialog)

From Java Tutorial 98- 3: Graphics and the Abstract Windowing Toolkit NAVO Tutorial -- Sept 23 1998. by Geoffrey C. Fox, Nancy McCracken

Window and Frame for Foil 54
1 Up to now, we have described how to build typical Applet panels inside browser window. There are classes that allow one to generate complete windows separately from the browser window
2 Window Class has subclasses Frame and Dialog
3 Create a window with a given title:
  • Frame f = new Frame("TitleofWindow");
  • Frames appear and disappear by using the method setVisible:
    • f.setVisible(true); // makes the window appear on the screen
    • f.setVisible(false); // makes the window disappear from the screen
  • Note Frame is a Container and can thereof be defined hierarchically with components that are laid out by LayoutManagers
  • Note a Frame in Java is NOT THE SAME as a frame in HTML

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sat Nov 28 1998