home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 November
/
Chip_1998-11_cd.bin
/
tema
/
Cafe
/
WDESAMPL.BIN
/
Calculate.java
< prev
next >
Wrap
Text File
|
1998-02-26
|
3KB
|
113 lines
/*
A basic extension of the java.applet.Applet class
*/
import java.awt.*;
import java.applet.*;
public class Calculate extends Applet
{
public void init()
{
// Take out this line if you don't use symantec.itools.net.RelativeURL or symantec.itools.awt.util.StatusScroller
symantec.itools.lang.Context.setApplet(this);
// This code is automatically generated by Visual Cafe when you add
// components to the visual environment. It instantiates and initializes
// the components. To modify the code, only use code syntax that matches
// what Visual Cafe can generate, or Visual Cafe may be unable to back
// parse your Java file into its visual environment.
//{{INIT_CONTROLS
GridBagLayout gridBagLayout;
gridBagLayout = new GridBagLayout();
setLayout(gridBagLayout);
setSize(262,144);
setBackground(new Color(16777215));
label1 = new java.awt.Label("Welcome to the Calculation Applet!");
label1.setBounds(29,12,204,23);
GridBagConstraints gbc;
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 0;
gbc.weightx = 1.0;
gbc.weighty = 1.0;
gbc.fill = GridBagConstraints.NONE;
gbc.insets = new Insets(0,0,0,0);
((GridBagLayout)getLayout()).setConstraints(label1, gbc);
add(label1);
SimpleCalcButton = new java.awt.Button();
SimpleCalcButton.setActionCommand("button");
SimpleCalcButton.setLabel("Simple Calculations");
SimpleCalcButton.setBounds(68,60,125,23);
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 1;
gbc.weightx = 1.0;
gbc.weighty = 1.0;
gbc.fill = GridBagConstraints.NONE;
gbc.insets = new Insets(0,0,0,0);
((GridBagLayout)getLayout()).setConstraints(SimpleCalcButton, gbc);
add(SimpleCalcButton);
LoanCalcButton = new java.awt.Button();
LoanCalcButton.setActionCommand("button");
LoanCalcButton.setLabel("Loan Calculations");
LoanCalcButton.setBounds(74,108,114,23);
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 2;
gbc.weightx = 1.0;
gbc.weighty = 1.0;
gbc.fill = GridBagConstraints.NONE;
gbc.insets = new Insets(0,0,0,0);
((GridBagLayout)getLayout()).setConstraints(LoanCalcButton, gbc);
add(LoanCalcButton);
//}}
//{{REGISTER_LISTENERS
Action lAction = new Action();
SimpleCalcButton.addActionListener(lAction);
LoanCalcButton.addActionListener(lAction);
//}}
//setFocus(SimpleCalcButton);
}
//{{DECLARE_CONTROLS
java.awt.Label label1;
java.awt.Button SimpleCalcButton;
java.awt.Button LoanCalcButton;
//}}
class Action implements java.awt.event.ActionListener
{
public void actionPerformed(java.awt.event.ActionEvent event)
{
Object object = event.getSource();
if (object == SimpleCalcButton)
SimpleCalcButton_Action(event);
else if (object == LoanCalcButton)
LoanCalcButton_Action(event);
}
}
void SimpleCalcButton_Action(java.awt.event.ActionEvent event)
{
// to do: code goes here.
//{{CONNECTION
// Create and show the Frame
(new CalculateFrame()).show();
//}}
}
void LoanCalcButton_Action(java.awt.event.ActionEvent event)
{
// to do: code goes here.
//{{CONNECTION
// Create and show the Frame
(new LoanCalcFrame()).show();
//}}
}
}