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 myFrame = new Frame("My Frame");
    myFrame.setSize(250, 250);
    myFrame.setLocation(300,200);
    myFrame.add("Center", new TextArea(10, 40));
    myFrame.show();
    
  }
  
}

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


Previous | Next | Top
Last Modified November 15, 1999
Copyright 1997-1999 Elliotte Rusty Harold
elharo@metalab.unc.edu