Examples of Dialogs

The following program displays a simple non-modal dialog with an OK Button and no title-bar.
import java.applet.*;
import java.awt.*; 

public class DialogTester extends Applet {

  public void init() {
    
    Dialog myDialog = new Dialog(new Frame(), false);
    myDialog.setLocation(320,240);
    myDialog.add("North", new Label("Hello!"));
    myDialog.add("South", new Button("OK"));
    myDialog.pack();
    myDialog.show();
    
  }
  
}

Previous | Next | Top
Last Modified July 4, 1999
Copyright 1997, 1999 Elliotte Rusty Harold
elharo@metalab.unc.edu