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

📄 frame1.java

📁 JAVA图形用户界面起步(文本输入组件) 图形用户界面起步(文本输入组件).
💻 JAVA
字号:
package wordgui;import java.awt.*;import java.awt.event.*;import javax.swing.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2004</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class Frame1 extends JFrame {  JPanel contentPane;  JLabel jLabel1 = new JLabel();  JTextField jTextField1 = new JTextField();  JPasswordField jPasswordField1 = new JPasswordField();  JTextArea jTextArea1 = new JTextArea();  //Construct the frame  public Frame1() {    enableEvents(AWTEvent.WINDOW_EVENT_MASK);    try {      jbInit();    }    catch(Exception e) {      e.printStackTrace();    }  }  //Component initialization  private void jbInit() throws Exception  {    contentPane = (JPanel) this.getContentPane();    jLabel1.setText("标签栏");    jLabel1.setBounds(new Rectangle(35, 37, 94, 23));    contentPane.setLayout(null);    this.setSize(new Dimension(282, 191));    this.setTitle("文本输入组件");    jTextField1.setText("文本域");    jTextField1.setBounds(new Rectangle(35, 76, 98, 23));    jPasswordField1.setText("密码域");    jPasswordField1.setBounds(new Rectangle(35, 115, 99, 23));    jTextArea1.setText("文本区");    jTextArea1.setBounds(new Rectangle(157, 34, 98, 103));    contentPane.add(jTextField1, null);    contentPane.add(jPasswordField1, null);    contentPane.add(jTextArea1, null);    contentPane.add(jLabel1, null);  }  //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 + -