国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

如何把一圖畫變成圖形界面的背景

2019-11-18 13:08:26
字體:
來源:轉載
供稿:網友

  java ATM機操作界面程序哦
  
  //以下是我寫的ATM操作界面的程序//
  //請高手賜教如何添加背景圖形????//
  
  import java.awt.*;
  import java.awt.event.*;
  
  public class AtmDialog
  {
  public static void main(String args[])
  {
  MyDialogFrame df=new MyDialogFrame();
  
  }
  }
  
  class MyDialogFrame extends Frame
  implements ActionListener,ComponentListener
  {
  Dialog MegDlg,InOutDlg;
  Label PRompt;
  Label prompt1;
  Button BTn1,btn2,btn3,btn4,btn5;
  TextField tf=new TextField("請按相關按鈕操作",25);
  TextField getMeg=new TextField("您目前的存款是1000元. 2004-11-22",10);
  TextField getMeg1=new TextField(20);
  MyDialogFrame()
  {
  super("ATM終端");
  prompt=new Label("歡迎您的光臨!");
  
  btn1=new Button("取款");
  btn2=new Button("查詢");
  
  btn3=new Button("確定");
  btn4=new Button("取消");
  btn5=new Button("返回");
  setLayout(new FlowLayout());
  add(prompt);
  add(tf);
  add(btn1);
  add(btn2);
  //add(btn3);
  //btn1.addComponentListener(this);
  
  getMeg1.addActionListener(this);
  btn1.addActionListener(this);
  btn2.addActionListener(this);
  //btn3.addActionListener(this);
  btn3.addActionListener(this);
  btn4.addActionListener(this);
  btn5.addActionListener(this);
  setSize(350,150);
  show();
  }
  public void actionPerformed(ActionEvent e)
  {
  
  if(e.getActionCommand()=="取款")
  {
  
  MegDlg=new Dialog(this,"請輸入取款金額",true);
  Panel p1=new Panel();
  
  MegDlg.add("Center",getMeg1);
  Panel p2=new Panel();
  p2.add(btn3);
  p2.add(btn4);
  MegDlg.add("South",p2);
  MegDlg.setSize(200,100);
  
  MegDlg.show();
  }
  else if(e.getActionCommand()=="查詢")
  {
  InOutDlg=new Dialog(this);
  InOutDlg.add("Center",getMeg);
  InOutDlg.add("South",btn5);
  InOutDlg.setSize(200,100);
  
  InOutDlg.show();
  }
  else if(e.getActionCommand()=="確定")
  {
  
  tf.setText("請取走金額...");
  getMeg.setText("您的帳戶余額為:(1000-"+getMeg1.getText()+")元");
  MegDlg.dispose();
  
  }
  // else if(getMeg1.getText()<getMeg.getText())
  
  else if(e.getActionCommand()=="取消")
  MegDlg.dispose();
  else if(e.getActionCommand()=="返回")
  {
  
  InOutDlg.dispose();
  }
  }
  public void componentShown(ComponentEvent e){}
  public void componentResized(ComponentEvent e){}
  public void componentMoved(ComponentEvent e){}
  public void componentHidden(ComponentEvent e){}
  
  }
  
  class WinAdpt extends WindowAdapter
  {
  public void windowClosing(WindowEvent e)
  {
  ((Frame)e.getWindow()).dispose();
  System.exit(0);
  }
  }

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 平原县| 黎平县| 东光县| 福州市| 白沙| 金阳县| 耒阳市| 简阳市| 肥城市| 晋江市| 合水县| 咸丰县| 离岛区| 武川县| 无锡市| 团风县| 商城县| 合川市| 长沙县| 怀宁县| 交城县| 广丰县| 曲阳县| 望谟县| 当涂县| 甘德县| 广东省| 韶山市| 开阳县| 抚顺县| 濮阳市| 简阳市| 信宜市| 资溪县| 蓝山县| 青冈县| 平果县| 常熟市| 社旗县| 远安县| 蒲江县|