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.add(BorderLayout.CENTER, new TextArea(10, 40));

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
Last Modified August 20, 2006