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

📄 frame1.java~3~

📁 是用java开发的一些程序原代码 是用java开发的一些程序原代码
💻 JAVA~3~
字号:
package ex09_03;import java.awt.*;import java.awt.event.*;import javax.swing.*;public class Frame1 extends JFrame {  JPanel contentPane;  GridLayout gridLayout1 = new GridLayout();  JButton jButton1 = new JButton();  JButton jButton2 = new JButton();  JButton jButton3 = new JButton();  JButton jButton4 = new JButton();  JButton jButton5 = new JButton();  JButton jButton6 = new JButton();  JButton jButton7 = new JButton();  JButton jButton8 = new JButton();  /**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();    jButton1.setText("jButton1");    contentPane.setLayout(gridLayout1);    this.setSize(new Dimension(400, 300));    this.setTitle("Frame Title");    gridLayout1.setRows(4);    gridLayout1.setColumns(2);    jButton2.setText("jButton2");    jButton3.setText("jButton3");    jButton4.setText("jButton4");    jButton5.setText("jButton5");    jButton6.setText("jButton6");    jButton7.setText("jButton7");    jButton8.setText("jButton8");    contentPane.add(jButton1, null);    contentPane.add(jButton5, null);    contentPane.add(jButton4, null);    contentPane.add(jButton3, null);    contentPane.add(jButton2, null);    contentPane.add(jButton6, null);    contentPane.add(jButton7, null);    contentPane.add(jButton8, 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 + -