home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgLangD.iso
/
VCAFE.3.0A
/
Sample.bin
/
Calculate.java
< prev
next >
Wrap
Text File
|
1998-11-08
|
3KB
|
101 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
setLayout(new GridBagLayout());
setBackground(java.awt.Color.white);
setSize(262,144);
label1.setText("Welcome to the Calculation Applet!");
add(label1,new com.symantec.itools.awt.GridBagConstraintsD(0,0,3,1,1.0,0.0,java.awt.GridBagConstraints.CENTER,java.awt.GridBagConstraints.HORIZONTAL,new Insets(12,29,0,29),0,0));
label1.setBounds(29,12,204,23);
SimpleCalcButton.setActionCommand("button");
SimpleCalcButton.setLabel("Simple Calculations");
add(SimpleCalcButton,new com.symantec.itools.awt.GridBagConstraintsD(0,1,2,1,0.0,0.0,java.awt.GridBagConstraints.CENTER,java.awt.GridBagConstraints.NONE,new Insets(25,68,0,0),0,0));
SimpleCalcButton.setBounds(68,60,125,23);
LoanCalcButton.setActionCommand("button");
LoanCalcButton.setLabel("Loan Calculations");
add(LoanCalcButton,new com.symantec.itools.awt.GridBagConstraintsD(0,2,1,1,0.0,0.0,java.awt.GridBagConstraints.CENTER,java.awt.GridBagConstraints.NONE,new Insets(25,74,13,0),0,0));
LoanCalcButton.setBounds(74,108,114,23);
//}}
//{{REGISTER_LISTENERS
SymAction lSymAction = new SymAction();
SimpleCalcButton.addActionListener(lSymAction);
LoanCalcButton.addActionListener(lSymAction);
//}}
}
//{{DECLARE_CONTROLS
java.awt.Label label1 = new java.awt.Label();
java.awt.Button SimpleCalcButton = new java.awt.Button();
java.awt.Button LoanCalcButton = 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 == SimpleCalcButton)
simpleCalcButton_ActionPerformed(event);
else if (object == LoanCalcButton)
loanCalcButton_ActionPerformed(event);
}
}
void simpleCalcButton_ActionPerformed(java.awt.event.ActionEvent event)
{
// to do: code goes here.
simpleCalcButton_ActionPerformed_Interaction1(event);
}
void simpleCalcButton_ActionPerformed_Interaction1(java.awt.event.ActionEvent event)
{
try {
// CalculateFrame Create and show the CalculateFrame with a title
(new CalculateFrame("Simple Calculations")).setVisible(true);
} catch (Exception e) {
}
}
void loanCalcButton_ActionPerformed(java.awt.event.ActionEvent event)
{
// to do: code goes here.
loanCalcButton_ActionPerformed_Interaction1(event);
}
void loanCalcButton_ActionPerformed_Interaction1(java.awt.event.ActionEvent event)
{
try {
// LoanCalcFrame Create and show the LoanCalcFrame with a title
(new LoanCalcFrame("Loan Calculations")).setVisible(true);
} catch (Exception e) {
}
}
}