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

📄 frame1.java~5~

📁 Java灵感编程1-101之61-80
💻 JAVA~5~
字号:
package getweb;import java.awt.*;import java.awt.event.*;import javax.swing.*;import java.io.*;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;  TextField textField1 = new TextField();  XYLayout xYLayout1 = new XYLayout();  Label label1 = new Label();  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");    label1.setText("请输入地址");    button1.setLabel("开始链接");    button1.addMouseListener(new java.awt.event.MouseAdapter() {      public void mouseClicked(MouseEvent e) {        button1_mouseClicked(e);      }    });    contentPane.add(label1,  new XYConstraints(24, 13, 83, 27));    contentPane.add(button1,  new XYConstraints(61, 60, 179, 33));    contentPane.add(textField1, new XYConstraints(115, 8, 161, 27));  }  //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_mouseClicked(MouseEvent e) {try{String s=textField1.getText();String command="c:\Programe Files\Internet Explorer\Iexplore.exe"+s;Runtime.getRuntime().exec(command);}catch(IOException ee){}}  }

⌨️ 快捷键说明

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