?? soapclient.java
字號:
package com.gpdi.www.ws.client;
//import java.awt.*;
import javax.swing.*;
//import java.net.*;
import java.io.*;
import java.awt.event.*;
public class SOAPClient extends WindowAdapter implements ActionListener {
JFrame frm;
JPanel pan, pan1;
JTextArea txta, txta1;
JScrollPane span, span1;
JTextField txtf, txtf1;
JButton btn;
JTabbedPane tab;
public void init() {
frm = new JFrame("SOAPClient");
pan = new JPanel();
pan1 = new JPanel();
txtf = new JTextField(36);
txtf1 = new JTextField(10);
txta = new JTextArea(26, 36);
txta1 = new JTextArea(26, 16);
span = new JScrollPane(txta);
span1 = new JScrollPane(txta1);
btn = new JButton("Send");
tab = new JTabbedPane();
tab.addTab("配置XML", pan);
tab.addTab("配置服務器", null);
tab.addTab("操作", null);
try {
} catch (Exception e) {
}
}
public void addElement() {
pan.add(txtf1);
pan.add(txtf);
pan.add(btn);
pan1.add(span);
pan1.add(span1);
frm.add(tab);
//frm.add(pan1);
//frm.add(pan, "South");
frm.pack();
txta1.setEnabled(false);
txta.setEnabled(false);
btn.addActionListener(this);
txtf.addActionListener(this);
frm.addWindowListener(this);
// frm.setSize(800,600);
frm.setLocation(100, 100);
frm.setResizable(false);
frm.setVisible(true);
frm.setDefaultCloseOperation(frm.EXIT_ON_CLOSE);
}
public void actionPerformed(ActionEvent e) {
try {
if (e.getSource().equals(btn)){
JFrame frm1;
frm1 = new JFrame("SOAPServer");
frm1.add(pan);
frm1.setLocation(100, 100);
frm1.pack();
frm1.setResizable(true);
frm1.setVisible(true);
frm1.setDefaultCloseOperation(frm.HIDE_ON_CLOSE);
}
} catch (Exception ee) {
}
}
public void windowClosing(WindowEvent e) {
int option = JOptionPane.showConfirmDialog(frm,
"Are you make sure to close?", "end program!",
JOptionPane.YES_NO_OPTION);
if (option == JOptionPane.YES_OPTION) {
try {
System.exit(0);
} catch (Exception ee) {
}
}
}
class Accept extends Thread {
public void run() {
try {
while (true) {
}
} catch (Exception eee) {
}
}
}
public static void main(String[] args) {
SOAPClient c = new SOAPClient();
c.init();
c.addElement();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -