⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frame1.java~2~

📁 方面
💻 JAVA~2~
字号:
package passwd;import java.awt.*;import java.awt.event.*;import javax.swing.*;import com.borland.jbcl.layout.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2002</p> * <p>Company: </p> * @author unascribed * @version 1.0 */public class Frame1 extends JFrame {  JPanel contentPane;  XYLayout xYLayout1 = new XYLayout();  Panel panel1 = new Panel();  Panel panel2 = new Panel();  Panel panel3 = new Panel();  Panel panel4 = new Panel();  TextField textField1 = new TextField();  CheckboxGroup checkboxGroup1 = new CheckboxGroup();  Checkbox checkbox1 = new Checkbox();  Checkbox checkbox2 = new Checkbox();  Label label1 = new Label();  TextField textField2 = new TextField();  Label label2 = new Label();  TextField textField3 = new TextField();  Button button1 = new Button();  //Construct the frame  public Frame1() {    enableEvents(AWTEvent.WINDOW_EVENT_MASK);    try {      jbInit();    }    catch(Exception e) {      e.printStackTrace();    }  }  //Component initialization  private void jbInit() throws Exception  {    //setIconImage(Toolkit.getDefaultToolkit().createImage(Frame1.class.getResource("[Your Icon]")));    contentPane = (JPanel) this.getContentPane();    contentPane.setLayout(xYLayout1);    this.setSize(new Dimension(400, 300));    this.setTitle("Frame Title");    textField1.setText("                   ");    checkbox1.setCheckboxGroup(checkboxGroup1);    checkbox1.setLabel("high");    checkbox1.setState(true);    checkbox2.setCheckboxGroup(checkboxGroup1);    checkbox2.setLabel("low");    label1.setText("user");    textField2.setEchoChar('*');    textField2.setText("                  ");    label2.setText("passwd");    textField3.setText("                                       ");    button1.setLabel("Check");    contentPane.add(panel1, new XYConstraints(8, 106, 64, 89));    panel1.add(checkbox1, null);    panel1.add(checkbox2, null);    contentPane.add(panel2,  new XYConstraints(110, 107, 209, 23));    panel2.add(label1, null);    panel2.add(textField1, null);    contentPane.add(panel3,  new XYConstraints(107, 165, 227, 32));    panel3.add(label2, null);    panel3.add(textField2, null);    contentPane.add(panel4,  new XYConstraints(251, 244, 90, 33));    panel4.add(button1, null);    contentPane.add(textField3,  new XYConstraints(34, 249, -1, -1));  }  //Overridden so we can exit when window is closed  protected void processWindowEvent(WindowEvent e) {    super.processWindowEvent(e);    if (e.getID() == WindowEvent.WINDOW_CLOSING) {      System.exit(0);    }  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -