FileDocCategorySizeDatePackage
QuitDialog.javaAPI DocExample2186Fri Jan 31 04:02:44 GMT 1997bank.client

QuitDialog

public class QuitDialog extends Dialog

Fields Summary
Button
yesButton
Button
noButton
Label
label1
Constructors Summary
public QuitDialog(Frame parent, boolean modal)


	    super(parent, modal);

		//{{INIT_CONTROLS
		setLayout(null);
		addNotify();
		resize(insets().left + insets().right + 337,insets().top + insets().bottom + 135);
		yesButton = new java.awt.Button(" Yes ");
		yesButton.reshape(insets().left + 72,insets().top + 80,79,22);
		yesButton.setFont(new Font("Dialog", Font.BOLD, 12));
		add(yesButton);
		noButton = new java.awt.Button("  No  ");
		noButton.reshape(insets().left + 185,insets().top + 80,79,22);
		noButton.setFont(new Font("Dialog", Font.BOLD, 12));
		add(noButton);
		label1 = new java.awt.Label("Do you really want to quit?");
		label1.reshape(insets().left + 78,insets().top + 33,180,23);
		add(label1);
		setTitle("A Basic Application - Quit");
		setResizable(false);
		//}}
	
public QuitDialog(Frame parent, String title, boolean modal)

	    this(parent, modal);
	    setTitle(title);
	
Methods Summary
public booleanhandleEvent(java.awt.Event event)

	    if(event.id == Event.WINDOW_DESTROY) {
	        hide();
	        return true;
	    }
		if (event.target == noButton && event.id == Event.ACTION_EVENT) {
			noButton_Clicked(event);
		}
		if (event.target == yesButton && event.id == Event.ACTION_EVENT) {
			yesButton_Clicked(event);
		}
		return super.handleEvent(event);
	
voidnoButton_Clicked(java.awt.Event event)

		//{{CONNECTION
		// Clicked from noButton Hide the Dialog
		hide();
		//}}
	
public synchronized voidshow()

    	Rectangle bounds = getParent().bounds();
    	Rectangle abounds = bounds();

    	move(bounds.x + (bounds.width - abounds.width)/ 2,
    	     bounds.y + (bounds.height - abounds.height)/2);

    	super.show();
    
voidyesButton_Clicked(java.awt.Event event)

	    getParent().handleEvent(new Event(this, Event.WINDOW_DESTROY, null));