Jbuilder100个例子 都是经典例子 对大家学习Jbuilder非常有帮助

源代码在线查看: word.java~36~

软件大小: 7397 K
上传用户: feigo156
关键词: Jbuilder 100
下载地址: 免注册下载 普通下载 VIP

相关代码

				package pass;								import java.awt.*;				import java.awt.event.*;				import java.applet.*;				import com.borland.jbcl.layout.*;				import javax.swing.*;								public class word extends Applet {				  boolean isStandalone = false;				  XYLayout xYLayout1 = new XYLayout();				  JPasswordField pass = new JPasswordField();				  JTextField name = new JTextField();				  JLabel l1 = new JLabel();				  JLabel l2 = new JLabel();				  JButton b1 = new JButton();				  /**Get a parameter value*/				  public String getParameter(String key, String def) {				    return isStandalone ? System.getProperty(key, def) :				      (getParameter(key) != null ? getParameter(key) : def);				  }								  /**Construct the applet*/				  public word() {				  }				  /**Initialize the applet*/				  public void init() {				    try {				      jbInit();				    }				    catch(Exception e) {				      e.printStackTrace();				    }				  }				  /**Component initialization*/				  private void jbInit() throws Exception {				    pass.setFont(new java.awt.Font("Dialog", 0, 16));				    pass.setToolTipText("");				    this.setLayout(xYLayout1);				    name.setFont(new java.awt.Font("SansSerif", 0, 16));				    l1.setFont(new java.awt.Font("Dialog", 0, 16));				    l1.setText("姓名");				    l2.setFont(new java.awt.Font("Dialog", 0, 16));				    l2.setText("密码");				    b1.setFont(new java.awt.Font("Dialog", 0, 16));				    b1.setText("确定");				    b1.addActionListener(new java.awt.event.ActionListener() {				      public void actionPerformed(ActionEvent e) {				        b1_actionPerformed(e);				      }				    });				    this.add(name,      new XYConstraints(120, 70, 109, 34));				    this.add(pass,    new XYConstraints(120, 109, 109, 34));				    this.add(l1,  new XYConstraints(67, 70, 72, 31));				    this.add(l2, new XYConstraints(67, 109, 76, 30));				    this.add(b1, new XYConstraints(158, 165, 71, 31));				  }				  /**Get Applet information*/				  public String getAppletInfo() {				    return "Applet Information";				  }				  /**Get parameter info*/				  public String[][] getParameterInfo() {				    return null;				  }								  void b1_actionPerformed(ActionEvent e) {				    if((name.getText() == "j")&&((pass.getPassword()).equals("j"))){				      name.setText("0");				      pass.setText("0");				      repaint();				      b1.setLabel(String.valueOf(pass.getPassword()));				    }				  //  else				  //    b1.setLabel(String.valueOf(pass.getPassword()));				  }				  public void paint(Graphics g){				      g.drawString("mimi",100,100);				  }								}			

相关资源