FileDocCategorySizeDatePackage
MessageBox.javaAPI DocJMF 2.1.1e1022Mon May 12 12:20:52 BST 2003com.sun.media.ui

MessageBox

public class MessageBox extends Frame
Displays an error message or any other message, with the given title and message

Fields Summary
Constructors Summary
public MessageBox(String title, String message)

	super(title);
	setLayout( new BorderLayout() );

	// Panel at the bottom with a flow layout to put an OK button
	Panel bottom = new Panel();
	bottom.setLayout( new FlowLayout() );
	Button ok = new Button("Grrr!!!");
	ok.addActionListener( new ActionListener() {
	    public void actionPerformed(ActionEvent ae) {
		dispose();
	    }
	} );
	bottom.add(ok);

	// Add a message label.
	add("Center", new Label(message, Label.CENTER));
	// Add the panel with the button to the south
	add("South", bottom);
	// Frame requires explicit setVisible(true)
	setVisible(true);
    
Methods Summary
public voidaddNotify()

	super.addNotify();
	pack();