📄 contoserver.java~1~
字号:
package dialog;import java.awt.*;import javax.swing.*;import java.awt.event.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2005</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class ContoServer extends JDialog { String host; JPanel panel1 = new JPanel(); JLabel jLabel1 = new JLabel(); JTextField jTextField1 = new JTextField(); public ContoServer(Frame frame, String title, boolean modal) { super(frame, title, modal); try { jbInit(); pack(); } catch(Exception ex) { ex.printStackTrace(); } } public ContoServer() { this(null, "", false); } private void jbInit() throws Exception { panel1.setLayout(null); jLabel1.setText("host:"); jTextField1.setText(""); jTextField1.addActionListener(new ContoServer_jTextField1_actionAdapter(this)); this.getContentPane().add(panel1, BorderLayout.EAST); this.getContentPane().add(jLabel1, BorderLayout.WEST); this.getContentPane().add(jTextField1, BorderLayout.CENTER); } public String gethost(){ return host; } void jTextField1_actionPerformed(ActionEvent e) { host=jTextField1.getText(); }}class ContoServer_jTextField1_actionAdapter implements java.awt.event.ActionListener { ContoServer adaptee; ContoServer_jTextField1_actionAdapter(ContoServer adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jTextField1_actionPerformed(e); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -