• java实例大全pdf > javabean:一个JAVABean的小例子
  • javabean:一个JAVABean的小例子

    免费下载 下载该文档 文档格式:PDF   更新时间:2009-11-03   下载次数:0   点击次数:1
    文档基本属性
    文档语言:Simplified Chinese
    文档格式:pdf
    文档作者:MC SYSTEM
    关键词:
    主题:
    备注:
    点击这里显示更多文档属性
    javabean:一个JAVABean的小例子
    疯狂代码 http://CrazyCoder.cn/ :http:/CrazyCoder.cn/Java/Article47371.html //Loan.java import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.beans.*; public Loan extends JPanel implements ActionListener { JLabel lType,lAmount,lmonth,lInstlmnt; JTextField tAmount,tmonth,tInstlmnt; JList tType; JButton submit; String loanType; String erestRates={"5","5","4"}; public String getInterestRates { erestRates; } public void InterestRates(String erestRates) { this.erestRates=erestRates; } public Loan { lType= JLabel("贷款类型:"); lAmount= JLabel("贷款金额:"); lmonth= JLabel("贷款月数:"); lInstlmnt= JLabel("每月应付金额:"); tAmount= JTextField(10); tmonth= JTextField(10); tInstlmnt= JTextField(10); String Type={"Housing","Personal","Car"}; tType= JList(Type); submit= JButton(" ¨"); Layout( GridLayout(5,2)); add(lType); add(tType);
    add(lAmount); add(tAmount); add(lmonth);add(tmonth); add(lInstlmnt);add(tInstlmnt); add(submit); lInstlmnt.Visible(false); tInstlmnt.Visible(false); submit.addActionListener(this); } public void actionPerformed(ActionEvent evt) { float lmnt=0; carloan=0; personalloan=0; houseloan=0; amount; noofmonth; JButton source=(JButton)evt.getSource; amount=Integer.parseInt(tAmount.getText); noofmonth=Integer.parseInt(tmonth.getText); //loanType = (String)tType.getSelectedValue; //tInstlmnt.Text("sample"); amtpermonth=amount/noofmonth; (!(erestRates[0]).equals("")) { carloan=Integer.parseInt(erestRates[0]); } (!(erestRates[1]).equals("")) { personalloan=Integer.parseInt(erestRates[1]); } (!(erestRates[2]).equals("")) { houseloan=Integer.parseInt(erestRates[2]); } loanType=(String)tType.getSelectedValue; (loanType.equals("Personal"))
    { lmnt=(personalloan*amount)/(100*noofmonth); } (loanType.equals("Housing")) { lmnt=(houseloan*amount)/(100*noofmonth); } (loanType.equals("Car")) { lmnt=(carloan*amount)/(100*noofmonth); } tInstlmnt.Text(String.valueOf(lmnt+amtpermonth)); lInstlmnt.Visible(true); tInstlmnt.Visible(true); tInstlmnt.Enabled(false); } } //LoanEditor.java import java.beans.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; public LoanEditor extends JPanel implements PropertyEditor,ActionListener { JLabel lcar,lpersonal,lhouse; JTextField tcar,tpersonal,thouse; String erestRates={"","",""}; JPanel Panel; public Object getValue { erestRates[0]=tcar.getText; erestRates[1]=tpersonal.getText; erestRates[2]=thouse.getText; erestRates; } public void Value(Object ctemp)

    下一页

  • 下载地址 (推荐使用迅雷下载地址,速度快,支持断点续传)
  • 免费下载 PDF格式下载
  • 您可能感兴趣的
  • java开发实例pdf  java实例开发教程pdf  java范例开发大全pdf  手机pdf阅读器java  javapdf  java教程pdf  javaweb开发详解pdf  java书籍免费下载pdf  java从入门到精通pdf