Basic HTML version of Foils prepared 13 October 97

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

From Java Tutorial, July 1, 1996 CSC499(JSU) CPS406/606 -- Fall Semester 97. by Nancy J. McCracken,Geoffrey C. Fox

Window and Frame for Foil 54
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
Window Class has subclasses Frame and Dialog
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



© 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 Wed Apr 1 1998