home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
inprise
/
JRUNTIME.Z
/
WelcomeFrame.java
< prev
next >
Wrap
Text File
|
1998-05-08
|
2KB
|
78 lines
package welcome;
import java.awt.*;
import java.awt.event.*;
import borland.jbcl.control.*;
import borland.jbcl.layout.*;
public class WelcomeFrame extends DecoratedFrame {
BorderLayout borderLayout1 = new BorderLayout();
BevelPanel panel1 = new BevelPanel();
XYLayout xYLayout1 = new XYLayout();
MenuBar menuBar1 = new MenuBar();
Menu menuFile = new Menu();
MenuItem menuFileExit = new MenuItem();
Menu menuHelp = new Menu();
MenuItem menuHelpAbout = new MenuItem();
// Construct the frame
public WelcomeFrame() {
try {
jbInit();
}
catch (Exception e) {
e.printStackTrace();
}
}
// Component initialization
private void jbInit() throws Exception {
this.setLayout(borderLayout1);
this.setTitle("Welcome to JBuilder");
menuFile.setLabel("File");
menuFileExit.setLabel("Exit");
menuFileExit.addActionListener(new WelcomeFrame_menuFileExit_ActionAdapter(this));
menuFile.add(menuFileExit);
menuHelp.setLabel("Help");
menuHelpAbout.setLabel("About");
menuHelpAbout.addActionListener(new WelcomeFrame_menuHelpAbout_ActionAdapter(this));
this.setMenuBar(menuBar1);
this.setSize(new Dimension(400, 300));
panel1.setLayout(xYLayout1);
menuHelp.add(menuHelpAbout);
menuBar1.add(menuFile);
menuBar1.add(menuHelp);
this.add(panel1, BorderLayout.CENTER);
}
//File | Exit action performed
public void fileExit_actionPerformed(ActionEvent e) {
System.exit(0);
}
//Help | About action performed
public void helpAbout_actionPerformed(ActionEvent e) {
}
}
class WelcomeFrame_menuFileExit_ActionAdapter implements ActionListener {
WelcomeFrame adaptee;
WelcomeFrame_menuFileExit_ActionAdapter(WelcomeFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.fileExit_actionPerformed(e);
}
}
class WelcomeFrame_menuHelpAbout_ActionAdapter implements ActionListener {
WelcomeFrame adaptee;
WelcomeFrame_menuHelpAbout_ActionAdapter(WelcomeFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.helpAbout_actionPerformed(e);
}
}