All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class distans.CCDBean

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window
                           |
                           +----java.awt.Dialog
                                   |
                                   +----distans.CCDBean

public class CCDBean
extends Dialog
The CCDBean class is a window dialog used to prompt the user for an String and/or an "yes" or "no".
A CCDBean is shown (and recieves all the user input as it is modal) as long as the user have not clicked the Ok or Cancel button or the closewindow button.


Variable Index

 o button1
 o button2
 o CCDOk
Indicates wheather the user clicked the Ok or the Cancel button.
 o info
 o input
Indicates wheater input (as a String) is to be taken or not.
 o inputField
 o label1
 o theText
The text that is shown to the user.

Constructor Index

 o CCDBean(Frame)
Constructor.

Method Index

 o button1_ActionPerformed(ActionEvent)
The Ok button was clicked.
 o button2_ActionPerformed(ActionEvent)
The Cancel button was clicked.
 o getText()
 o inputField_EnterHit(ActionEvent)
Checks that there is input set if input is required.
 o Ok()
 o setInput(boolean)
Sets the (user)input variable to true or false.
 o setText(String)
Sets the text to be shown to the user.
 o show()
Sets the variables to their values/states when the window is about to be shown.

Variables

 o CCDOk
 protected boolean CCDOk
Indicates wheather the user clicked the Ok or the Cancel button.

 o input
 private boolean input
Indicates wheater input (as a String) is to be taken or not.

 o theText
 private String theText
The text that is shown to the user. It is a question or a request.

 o inputField
 TextField inputField
 o label1
 Label label1
 o button1
 Button button1
 o info
 Label info
 o button2
 Button button2

Constructors

 o CCDBean
 public CCDBean(Frame father)
Constructor. Initiates the graphical components.

Methods

 o setText
 public void setText(String text)
Sets the text to be shown to the user.

 o getText
 public String getText()
Returns:
the text that the user has typed.
 o Ok
 public boolean Ok()
Returns:
CCDOk, which is true if the user clicked the Ok button and false if the user clicked the Cancel button.
 o setInput
 public void setInput(boolean state)
Sets the (user)input variable to true or false.

Parameters:
state - the state that input is set to.
 o show
 public void show()
Sets the variables to their values/states when the window is about to be shown. Then shows the dialog by calling super.

Overrides:
show in class Dialog
 o inputField_EnterHit
 void inputField_EnterHit(ActionEvent event)
Checks that there is input set if input is required. If it is all right it sets CCDOk to true (Ok was clicked...) and hides the dialog.

 o button1_ActionPerformed
 void button1_ActionPerformed(ActionEvent event)
The Ok button was clicked.
Does the same as inputField_EnterHit.

 o button2_ActionPerformed
 void button2_ActionPerformed(ActionEvent event)
The Cancel button was clicked.
Sets CCDOk to false and hides the dialog.


All Packages  Class Hierarchy  This Package  Previous  Next  Index