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

📄 intercalate.java

📁 企业级的即时通软件。。java语言写的 这是服务端部份。
💻 JAVA
字号:
package edu.sccp.chat.frame;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.StringTokenizer;

import javax.swing.BorderFactory;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import com.swtdesigner.SwingResourceManager;

import edu.sccp.chat.tools.*;
import edu.sccp.chat.jarClass.JarAllege;

public class Intercalate {

	private JTextField textField_1;
	private JTextField textField;
	/**
	 * @param args
	 */
	JFrame frame;
	
	public Intercalate()
	{
		JarAllege.bai();
		initGUI();
	}
	private void initGUI()
	{
		frame=new JFrame("查看服务器设置");
		frame.setIconImage(SwingResourceManager.getImage(Intercalate.class, "/edu/sccp/chat/image/zhuxiao.png"));
		frame.getContentPane().setLayout(null);
		frame.addWindowListener(new WindowAdapter() {
			public void windowClosing(final WindowEvent e) {
				frame.dispose();
			}
		});
		String str=""+MainGUI.SOCKET;

		final JButton close = new JButton();
		close.addActionListener(new ActionListener() {
			public void actionPerformed(final ActionEvent e) {
				frame.dispose();
			}
		});
		close.setText("关闭");
		close.setBounds(131, 118, 73, 25);
		frame.getContentPane().add(close);
		String ip = null;
		try {
			ip=InetAddress.getLocalHost().toString();
		} catch (UnknownHostException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		StringTokenizer st=new StringTokenizer(ip,"/");   
        String i1=st.nextToken();
        String i2=st.nextToken();

		final JPanel panel = new JPanel();
		panel.setLayout(null);
		panel.setBorder(BorderFactory.createTitledBorder("服务器设置"));
		panel.setBounds(10, 10, 207, 102);
		frame.getContentPane().add(panel);

		final JLabel label_2 = new JLabel();
		label_2.setBounds(10, 34, 57, 16);
		panel.add(label_2);
		label_2.setText("本机IP:");

		textField = new JTextField();
		textField.setBounds(53, 32, 116, 21);
		panel.add(textField);
		textField.setEditable(false);
		textField.setText(i2);
		final JLabel label = new JLabel();
		label.setBounds(10, 71, 61, 16);
		panel.add(label);
		label.setText("端口号:");

		textField_1 = new JTextField();
		textField_1.setBounds(53, 69, 117, 21);
		panel.add(textField_1);
		textField_1.setEditable(false);
		textField_1.setText(""+MainGUI.SOCKET);
	}
	public void showGUI()
	{
		frame.setResizable(false);
		frame.setSize(233,180);
		frame.setLocationRelativeTo(null);
		frame.setVisible(true);
	}
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		//new Intercalate().showGUI();
	}

}

⌨️ 快捷键说明

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