ATM系统实现[3]——余额查询窗口[00原创]
2007-07-23 20:14
501 查看
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;
/**
* 余额查询窗口
* @author 88250
*/
public class BalanceQueryComposite extends Composite
{
/**
* 返回按钮
*/
private Button returnBtn = null;
/**
* 提示可取款数标签
*/
private Label promptAvailableAmountLbl = null;
/**
* 可取款数显示域
*/
private Text availableAmountText = null;
/**
* 余额显示域
*/
private Text balanceText = null;
/**
* 提示余额标签
*/
private Label promptBalanceLbl = null;
/**
* 提示帐户类型标签
*/
private Label promptAccountTypeLbl = null;
/**
* 帐户类型显示域
*/
private Text accountTypeText = null;
/**
* 帐户ID显示域
*/
private Text accountIDText = null;
/**
* 提示帐户ID标签
*/
private Label promptAccountIDLbl = null;
/**
* 创建余额查询窗口容器
* @param parent 父窗口容器
*/
public BalanceQueryComposite(Composite parent)
{
super(parent, SWT.NONE);
createContents();
}
/**
* 显示帐户相关信息
*/
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("网络连接出现问题....");
exitDlg.setMessage("不能连接到服务器,系统将退出!");
exitDlg.open();
System.exit(0);
re.printStackTrace();
}
catch (Exception e)
{
e.printStackTrace();
}
}
/**
* 创建余额查询窗口容器内含控件
*/
private void createContents()
{
promptAccountIDLbl = new Label(this, SWT.NONE);
promptAccountIDLbl.setText("帐户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("帐户类型:");
promptAccountTypeLbl.setBounds(14, 51, 65, 20);
promptBalanceLbl = new Label(this, SWT.NONE);
promptBalanceLbl.setText("当前余额:");
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("可取款数:");
promptAvailableAmountLbl.setBounds(17, 122, 65, 20);
returnBtn = new Button(this, SWT.BORDER);
returnBtn.setText("返回");
returnBtn.setBounds(124, 154, 40, 30);
}
/**
* 取得返回按钮
* @return 返回按钮
*/
public Button getReturnLbl()
{
return returnBtn;
}
@Override
public void dispose()
{
super.dispose();
}
@Override
protected void checkSubclass()
{
// Disable the check that prevents subclassing of SWT components
}
}
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;
/**
* 余额查询窗口
* @author 88250
*/
public class BalanceQueryComposite extends Composite
{
/**
* 返回按钮
*/
private Button returnBtn = null;
/**
* 提示可取款数标签
*/
private Label promptAvailableAmountLbl = null;
/**
* 可取款数显示域
*/
private Text availableAmountText = null;
/**
* 余额显示域
*/
private Text balanceText = null;
/**
* 提示余额标签
*/
private Label promptBalanceLbl = null;
/**
* 提示帐户类型标签
*/
private Label promptAccountTypeLbl = null;
/**
* 帐户类型显示域
*/
private Text accountTypeText = null;
/**
* 帐户ID显示域
*/
private Text accountIDText = null;
/**
* 提示帐户ID标签
*/
private Label promptAccountIDLbl = null;
/**
* 创建余额查询窗口容器
* @param parent 父窗口容器
*/
public BalanceQueryComposite(Composite parent)
{
super(parent, SWT.NONE);
createContents();
}
/**
* 显示帐户相关信息
*/
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("网络连接出现问题....");
exitDlg.setMessage("不能连接到服务器,系统将退出!");
exitDlg.open();
System.exit(0);
re.printStackTrace();
}
catch (Exception e)
{
e.printStackTrace();
}
}
/**
* 创建余额查询窗口容器内含控件
*/
private void createContents()
{
promptAccountIDLbl = new Label(this, SWT.NONE);
promptAccountIDLbl.setText("帐户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("帐户类型:");
promptAccountTypeLbl.setBounds(14, 51, 65, 20);
promptBalanceLbl = new Label(this, SWT.NONE);
promptBalanceLbl.setText("当前余额:");
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("可取款数:");
promptAvailableAmountLbl.setBounds(17, 122, 65, 20);
returnBtn = new Button(this, SWT.BORDER);
returnBtn.setText("返回");
returnBtn.setBounds(124, 154, 40, 30);
}
/**
* 取得返回按钮
* @return 返回按钮
*/
public Button getReturnLbl()
{
return returnBtn;
}
@Override
public void dispose()
{
super.dispose();
}
@Override
protected void checkSubclass()
{
// Disable the check that prevents subclassing of SWT components
}
}
相关文章推荐
- ATM系统实现[8]——转帐查询窗口[00原创]
- ATM系统实现[9]——事务查询窗口[00原创]
- ATM系统实现[7]——服务选择窗口[00原创]
- ATM系统实现[10]——转帐窗口[00原创]
- ATM系统实现[2]——密码修改窗口[00原创]
- ATM系统实现[11]——取款窗口[00原创]
- ATM系统实现[4]——帐户选择窗口[00原创]
- ATM系统实现[5]——注意事项窗口[00原创]
- ATM系统实现[14]——可用帐户类[00原创]
- ATM系统实现[16]——交易事务类[00原创]
- ATM系统实现[18]——数据管理类[00原创]
- ATM系统实现[15]——身份验证类[00原创]
- ATM系统实现[19]——服务端[00原创]
- ATM系统实现[1]——用户登录界面[00原创]
- ATM系统实现[17]——数据格式验证类[00原创]
- ATM系统实现[12]——抽象转户类[00原创]
- ATM系统实现[6]——密码面板组件[00原创]
- ATM系统实现[13]——业务帐户类[00原创]
- ATM系统设计报告[00原创]
- ATM系统开发日志[5] [00原创]