helloframe.java~9~

来自「文件加密软件」· JAVA~9~ 代码 · 共 63 行

JAVA~9~
63
字号
package com.borland.samples.welcome;

import javax.swing.*;
import java.awt.FlowLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class Helloframe
    extends JFrame {
  public Helloframe() {
    System.out.println(System.currentTimeMillis());
    init();
    try {
      jbInit();
    }
    catch (Exception ex) {
      ex.printStackTrace();
    }
  }
  void init(){
    FlowLayout fl = new FlowLayout();
    JLabel j = new JLabel("hello word");
    JTextField jtf = new JTextField("          ");

    this.getContentPane().setLayout(fl);
    this.add(j);
    this.add(jtf);
    this.setSize(100,100);
    this.show(true);
  }

  private void jbInit() throws Exception {
    jTextArea1.setText("jTextArea1");
    this.getContentPane().add(jTextArea1);
    this.getContentPane().add(jButton1);
    jButton1.setText("jButton1");
    jButton1.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        jButton1_actionPerformed(e);
      }
    });
  }

  JTextArea jTextArea1 = new JTextArea();
  JButton jButton1 = new JButton();
  public void jButton1_actionPerformed(ActionEvent e) {
    System.out.println(JOptionPane.showConfirmDialog(null, "输入次数已过", "提示",
					JOptionPane.CANCEL_OPTION));
  }
}

⌨️ 快捷键说明

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