All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.BSNumberTextFieldsSampleApplets.BSPriceCalculationApplet

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----java.applet.Applet
                                   |
                                   +----COM.BSNumberTextFieldsSampleApplets.BSPriceCalculationApplet

public class BSPriceCalculationApplet
extends Applet
implements ActionListener
A sample Applet for testing BSNumberTextFields.

This Applet allows you to calculate the extended price for any item, given its unit price and quantity.

The unit price and extension price are of type BSDoubleTextField, the quantity is of type BSIntegerTextField. The prefixString properties have been exploited in this sample applet to show how the BSDoubleTextField can be used to display currency.


Variable Index

 o ivjButton1
 o ivjExtendedPriceBSDoubleTextField
 o ivjLabel1
 o ivjLabel2
 o ivjLabel3
 o ivjLabel4
 o ivjQuantityBSIntegerTextField
 o ivjUnitPriceBSDoubleTextField

Constructor Index

 o BSPriceCalculationApplet()

Method Index

 o actionPerformed(ActionEvent)
Method to handle events for the ActionListener interface.
 o calculateExtendedPrice(Double, Long)
This method was calculates the extended price by multiplying p (price) and q (quantity).
 o conn0(ActionEvent)
conn0
 o conn3(String)
conn3
 o conn4()
conn4
 o getAppletInfo()
Gets the applet information.
 o getButton1()
Return the Button1 property value.
 o getExtendedPriceBSDoubleTextField()
Return the ExtendedPriceBSDoubleTextField property value.
 o getLabel1()
Return the Label1 property value.
 o getLabel2()
Return the Label2 property value.
 o getLabel3()
Return the Label3 property value.
 o getLabel4()
Return the Label4 property value.
 o getQuantityBSIntegerTextField()
Return the QuantityBSIntegerTextField property value.
 o getUnitPriceBSDoubleTextField()
Return the UnitPriceBSDoubleTextField property value.
 o handleException(Throwable)
Called whenever the part throws an exception.
 o init()
Handle the Applet init method.
 o initConnections()
Initializes connections
 o main(String[])
main entrypoint - starts the part when it is run as an application
 o start()
Method to handle events for the Applet interface.

Variables

 o ivjButton1
 private Button ivjButton1
 o ivjExtendedPriceBSDoubleTextField
 private BSDoubleTextField ivjExtendedPriceBSDoubleTextField
 o ivjLabel1
 private Label ivjLabel1
 o ivjLabel2
 private Label ivjLabel2
 o ivjLabel3
 private Label ivjLabel3
 o ivjLabel4
 private Label ivjLabel4
 o ivjQuantityBSIntegerTextField
 private BSIntegerTextField ivjQuantityBSIntegerTextField
 o ivjUnitPriceBSDoubleTextField
 private BSDoubleTextField ivjUnitPriceBSDoubleTextField

Constructors

 o BSPriceCalculationApplet
 public BSPriceCalculationApplet()

Methods

 o actionPerformed
 public void actionPerformed(ActionEvent e)
Method to handle events for the ActionListener interface.

Parameters:
e - java.awt.event.ActionEvent
 o calculateExtendedPrice
 private String calculateExtendedPrice(Double p,
                                       Long q)
This method was calculates the extended price by multiplying p (price) and q (quantity). The result is returned as a String.

Parameters:
p - Double
q - Long
Returns:
java.lang.String
 o conn0
 private String conn0(ActionEvent arg1)
conn0

Parameters:
arg1 - java.awt.event.ActionEvent
Returns:
java.lang.String
 o conn3
 private void conn3(String result)
conn3

Parameters:
result - java.lang.String
 o conn4
 private void conn4()
conn4

 o getAppletInfo
 public String getAppletInfo()
Gets the applet information.

Returns:
java.lang.String
Overrides:
getAppletInfo in class Applet
 o getButton1
 private Button getButton1()
Return the Button1 property value.

Returns:
java.awt.Button
 o getExtendedPriceBSDoubleTextField
 private BSDoubleTextField getExtendedPriceBSDoubleTextField()
Return the ExtendedPriceBSDoubleTextField property value.

Returns:
COM.BSNumberTextFields.BSDoubleTextField
 o getLabel1
 private Label getLabel1()
Return the Label1 property value.

Returns:
java.awt.Label
 o getLabel2
 private Label getLabel2()
Return the Label2 property value.

Returns:
java.awt.Label
 o getLabel3
 private Label getLabel3()
Return the Label3 property value.

Returns:
java.awt.Label
 o getLabel4
 private Label getLabel4()
Return the Label4 property value.

Returns:
java.awt.Label
 o getQuantityBSIntegerTextField
 private BSIntegerTextField getQuantityBSIntegerTextField()
Return the QuantityBSIntegerTextField property value.

Returns:
COM.BSNumberTextFields.BSIntegerTextField
 o getUnitPriceBSDoubleTextField
 private BSDoubleTextField getUnitPriceBSDoubleTextField()
Return the UnitPriceBSDoubleTextField property value.

Returns:
COM.BSNumberTextFields.BSDoubleTextField
 o handleException
 private void handleException(Throwable exception)
Called whenever the part throws an exception.

Parameters:
exception - java.lang.Throwable
 o init
 public void init()
Handle the Applet init method.

Overrides:
init in class Applet
 o initConnections
 private void initConnections()
Initializes connections

 o main
 public static void main(String args[])
main entrypoint - starts the part when it is run as an application

Parameters:
args - java.lang.String[]
 o start
 public void start()
Method to handle events for the Applet interface.

Overrides:
start in class Applet

All Packages  Class Hierarchy  This Package  Previous  Next  Index