home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgLangD.iso
/
VCAFE.3.0A
/
Sample.bin
/
AboutDialog.java
< prev
next >
Wrap
Text File
|
1998-11-02
|
2KB
|
89 lines
/*
A basic extension of the java.awt.Dialog class
*/
import java.awt.*;
public class AboutDialog extends Dialog {
public AboutDialog(Frame parent, boolean modal) {
super(parent, modal);
//{{INIT_CONTROLS
setLayout(null);
setSize(357,158);
setVisible(false);
label1.setText("JavaPad - A Simple editor written in Java!");
add(label1);
label1.setBounds(50,40,251,21);
okButton.setLabel("OK");
add(okButton);
okButton.setBounds(120,70,95,26);
setTitle("About");
//}}
//{{REGISTER_LISTENERS
SymAction lSymAction = new SymAction();
okButton.addActionListener(lSymAction);
//}}
}
public AboutDialog(Frame parent, String title, boolean modal) {
this(parent, modal);
setTitle(title);
}
//-------------------------------------------------------------
// This file has been migrated from the 1.0 to 1.1 event model.
// This method is not used with the new 1.1 event model. You can
// move any code you need to keep, then remove this method.
//-------------------------------------------------------------
//
// public boolean handleEvent(Event event) {
// if(event.id == Event.WINDOW_DESTROY) {
// hide();
// return true;
// }
// if (event.target == okButton && event.id == Event.ACTION_EVENT) {
// okButton_Clicked(event);
// }
// return super.handleEvent(event);
// }
//-------------------------------------------------------------
//{{DECLARE_CONTROLS
java.awt.Label label1 = new java.awt.Label();
java.awt.Button okButton = new java.awt.Button();
//}}
class SymAction implements java.awt.event.ActionListener
{
public void actionPerformed(java.awt.event.ActionEvent event)
{
Object object = event.getSource();
if (object == okButton)
okButton_ActionPerformed(event);
}
}
void okButton_ActionPerformed(java.awt.event.ActionEvent event)
{
// to do: code goes here.
okButton_ActionPerformed_Interaction1(event);
}
void okButton_ActionPerformed_Interaction1(java.awt.event.ActionEvent event)
{
try {
this.dispose();
} catch (Exception e) {
}
}
}