ATM system implementation [3] -- balance query window [00 original]

Source: Internet
Author: User
Package cn.edu. ynu. Sei. ATM. Client. UI;

Import java. RMI. RemoteException;
Import org. Eclipse. SWT. SWT;
Import org. Eclipse. SWT. Widgets. Button;
Import org. Eclipse. SWT. Widgets. composite;
Import org. Eclipse. SWT. Widgets. label;
Import org. Eclipse. SWT. Widgets. MessageBox;
Import org. Eclipse. SWT. Widgets. text;

/**
* Balance query window
* @ Author 88250
*/
Public class balancequerycomposite extends Composite
{
/**
* Return button
*/
Private button returnbtn = NULL;

/**
* Indicates the number of acceptable tags.
*/
Private Label promptavailableamountlbl = NULL;

/**
* Display the number of optional fields
*/
Private text availableamounttext = NULL;

/**
* Balance display domain
*/
Private text balancetext = NULL;

/**
* Balance label prompt
*/
Private Label promptbalancelbl = NULL;

/**
* The Account type label is displayed.
*/
Private Label promptaccounttypelbl = NULL;

/**
* Account type display domain
*/
Private text accounttypetext = NULL;

/**
* Account ID Display domain
*/
Private text accountidtext = NULL;

/**
* The account ID label is displayed.
*/
Private Label promptaccountidlbl = NULL;

/**
* Create a balance query window container
* @ Param parent window container
*/
Public balancequerycomposite (composite parent)
{
Super (parent, SWT. None );
Createcontents ();
}

/**
* Display account information
*/
Public void displayaccountinfo ()
{
Try
{
Accountidtext. settext (integer
. Tostring (accountselectcomposite. Account. GETID ()));
Accounttypetext. settext (accountselectcomposite. Account
. Getaccounttype ());
Balancetext. settext (float. tostring (accountselectcomposite. Account
. Getbalance ()));
Availableamounttext. settext (float
. Tostring (accountselectcomposite. Account. getremain ()));
}
Catch (RemoteException re)
{
MessageBox exitdlg = new MessageBox (this. getshell ());
Exitdlg. settext ("network connection problems ....");
Exitdlg. setmessage ("cannot connect to the server, and the system will quit! ");
Exitdlg. open ();
System. Exit (0 );
Re. printstacktrace ();
}
Catch (exception E)
{
E. printstacktrace ();
}
}

/**
* Create a balance query window container containing controls
*/
Private void createcontents ()
{
Promptaccountidlbl = new label (this, SWT. None );
Promptaccountidlbl. settext ("account ID :");
Promptaccountidlbl. setbounds (26, 20, 55, 20 );

Accountidtext = new text (this, SWT. Border );
Accountidtext. seteditable (false );
Accountidtext. setbounds (82, 14, 80, 25 );
Accounttypetext = new text (this, SWT. Border );
Accounttypetext. seteditable (false );
Accounttypetext. setbounds (82, 46, 80, 25 );

Promptaccounttypelbl = new label (this, SWT. None );
Promptaccounttypelbl. settext ("Account type :");
Promptaccounttypelbl. setbounds (14, 51, 65, 20 );

Promptbalancelbl = new label (this, SWT. None );
Promptbalancelbl. settext ("Current Balance :");
Promptbalancelbl. setbounds (15, 86, 65, 20 );

Balancetext = new text (this, SWT. Border );
Balancetext. seteditable (false );
Balancetext. setbounds (83, 82, 80, 25 );

Availableamounttext = new text (this, SWT. Border );
Availableamounttext. seteditable (false );
Availableamounttext. setbounds (83,118, 80, 25 );

Promptavailableamountlbl = new label (this, SWT. None );
Promptavailableamountlbl. settext ("value :");
Promptavailableamountlbl. setbounds (17,122, 65, 20 );

Returnbtn = new button (this, SWT. Border );
Returnbtn. settext ("return ");
Returnbtn. setbounds (124,154, 40, 30 );
}

/**
* Get the return button
* @ Return: Return button
*/
Public button getreturnlbl ()
{
Return returnbtn;
}

@ Override
Public void dispose ()
{
Super. Dispose ();
}

@ Override
Protected void checksubclass ()
{
// Disable the check that prevents subclassing of SWT Components
}

}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.