📄 frame1.java~7~
字号:
package getip;import java.awt.*;import java.awt.event.*;import javax.swing.*;import com.borland.jbcl.layout.*;/** * <p>Title: no</p> * <p>Description: This a Java builder program</p> * <p>Copyright: Copyright (c) 2002</p> * <p>Company: home</p> * @author liujun * @version 1.0 */public class Frame1 extends JFrame { private JPanel contentPane; private JLabel jLabel1 = new JLabel(); private JTextField jTextField1 = new JTextField(); private JButton jButton1 = new JButton(); private XYLayout xYLayout1 = new XYLayout(); private JLabel jLabel2 = new JLabel(); //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(); jLabel1.setText(" "); contentPane.setLayout(xYLayout1); this.setSize(new Dimension(333, 214)); this.setTitle("Frame Title"); jTextField1.setText("cs.hust.edu.cn"); jButton1.setText("查询IP地址信息"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jButton1_actionPerformed(e); } }); jLabel2.setText(" "); contentPane.add(jLabel1, new XYConstraints(42, 73, 263, 25)); contentPane.add(jButton1, new XYConstraints(44, 18, 235, -1)); contentPane.add(jTextField1, new XYConstraints(48, 152, 241, -1)); contentPane.add(jLabel2, new XYConstraints(42, 107, 269, 23)); } //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 jButton1_actionPerformed(ActionEvent e) { }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -