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

📄 frame1.java~9~

📁 很好得jbuilder100例源代码
💻 JAVA~9~
字号:
package clipboard;import java.awt.*;import java.awt.event.*;import javax.swing.*;public class Frame1 extends JFrame {  JPanel contentPane;  BorderLayout borderLayout1 = new BorderLayout();  Button button1 = new Button();  Button button2 = 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();    button1.setLabel("copy");    button1.addActionListener(new java.awt.event.ActionListener() {      public void actionPerformed(ActionEvent e) {        button1_actionPerformed(e);      }    });    contentPane.setLayout(borderLayout1);    this.setSize(new Dimension(309, 278));    this.setTitle("ClipBoard演示程序");    MyTextArea mta = new MyTextArea();    button2.setLabel("paste");    button2.addActionListener(new java.awt.event.ActionListener() {      public void actionPerformed(ActionEvent e) {        button2_actionPerformed(e);      }    });    contentPane.add(button1,  BorderLayout.NORTH);    contentPane.add(button2,  BorderLayout.SOUTH);    contentPane.add(mta,BorderLayout.CENTER);  }  /**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);    }  }  void button1_actionPerformed(ActionEvent e) {    mta.copy();  }  void button2_actionPerformed(ActionEvent e) {    mta.paste();  }}

⌨️ 快捷键说明

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