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

📄 infopanel.java

📁 基于Socket的java多用户视频聊天程序
💻 JAVA
字号:
package ipconfig;import java.awt.*;import javax.swing.*;import java.io.*;import java.net.*;import java.awt. event.*;import javax.swing.border.*;/** * Title:        获取网站信息 * Description:  该实例从Internet网络中获取一个服务器的IP地址、机器名称、子网掩码、DNS配置等信息。 * Copyright:    Copyright (c) 2002 * Company:      北京师范大学计算机系 * @author 梁志伟 * @version 1.0 */public class InfoPanel extends JPanel {		GridLayout gridLayout1 = new GridLayout(5,2,1,1);		JLabel displayLabel = new JLabel();		JLabel namelabel = new JLabel();		JLabel name = new JLabel();		JLabel ipLabel = new JLabel();		JLabel ip = new JLabel();		JLabel display = new JLabel();		JLabel host = new JLabel();		JLabel hostLabel = new JLabel();		JLabel full = new JLabel();		JLabel fullLabel = new JLabel();		Info cfg;  	public InfoPanel(Info cfg) {			this.cfg =cfg;			try {				jbInit();    			}			catch(Exception e) {				e.printStackTrace();    			}  		}		private void jbInit() throws Exception {			Border border=new BevelBorder(BevelBorder.RAISED);			String names=cfg.getName() ;			border=new TitledBorder(border,names);			setBorder(border);			displayLabel.setText("DisplayName:");			this.setLayout(gridLayout1);			namelabel.setText("Name:");			name.setForeground(Color.red);			name.setText(cfg.getName() );			ipLabel.setText("Address:");			ip.setForeground(Color.red);			ip.setText(cfg.getAddress() );			display.setForeground(Color.red);			display.setText(cfg.getDisplayName());			host.setForeground(Color.red);			host.setText(cfg.getHostName());			hostLabel.setText("HosName:");			full.setForeground(Color.red);			full.setText(cfg.getFullName() );			fullLabel.setText("FullName:");			this.add(displayLabel, null);			this.add(display, null);			this.add(namelabel, null);			this.add(name, null);			this.add(ipLabel, null);			this.add(ip, null);			this.add(hostLabel, null);			this.add(host, null);			this.add(fullLabel, null);			this.add(full, null);}}

⌨️ 快捷键说明

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