📄 dialogconnection.java~11~
字号:
package multiclientnew;
import java.awt.BorderLayout;
import java.awt.Frame;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.JLabel;
import java.awt.Rectangle;
import javax.swing.BorderFactory;
import java.awt.Color;
import javax.swing.JButton;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2007</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class DialogConnection extends JDialog {
String nameRequest;
String ipRequest;
JLabel jLabel1 = new JLabel();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
public DialogConnection(Frame owner, String title, boolean modal) {
super(owner, title, modal);
try {
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
jbInit();
pack();
} catch (Exception exception) {
exception.printStackTrace();
}
}
public DialogConnection(String namerequest,String iprequest) {
this(new Frame(), "DialogConnection", false);
System.out.println("qwe");
nameRequest = namerequest;
ipRequest = iprequest;
try {
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
System.out.println("rrrr");
jbInit();
pack();
} catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
System.out.println("tttttt");
this.setLocation(500,300);
this.getContentPane().setSize(300,300);
this.getContentPane().setLayout(null);
jLabel1.setBorder(BorderFactory.createEtchedBorder());
jLabel1.setText("jLabel1");
jLabel1.setBounds(new Rectangle(28, 23, 267, 58));
jButton2.setBounds(new Rectangle(175, 107, 120, 37));
jButton2.setText("jButton2");
this.getContentPane().add(jLabel1);
this.getContentPane().add(jButton1);
this.getContentPane().add(jButton2);
jButton1.setBounds(new Rectangle(28, 115, 117, 33));
jButton1.setText("jButton1");
this.setVisible(true);
this.setUndecorated(true);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -