Frame Example

What follows is a very simple program that puts up a window. You can move the window and resize it. The window has a single TextArea component that lets you edit some text.

import java.awt.*;

public class FrameTester {

  public static void main(String[] args) {
        
    Frame f = new Frame("App Frame");
    f.setSize(250, 250);
    f.setLocation(300,200);
    f.add(BorderLayout.CENTER, new TextArea(10, 40));
    f.setVisible(true);
    
  }
  
}

This window cannot be closed because it does not yet respond to the WINDOW_CLOSING event.


Previous | Next | Top | Cafe au Lait

Copyright 1997-1999, 2006 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified August 20, 2006