client.java~1~
来自「1. 消息即时通信 2. 消息发送实现一对一、一对多等多种发送模式 3. 发」· JAVA~1~ 代码 · 共 55 行
JAVA~1~
55 行
import java.awt.*;import java.awt.event.*;import java.applet.*;import javax.swing.*;public class Client extends JApplet { private boolean isStandalone = false; //LoginDialog loginDialog=new LoginDialog(); ChatArea chatarea=new ChatArea(); //Get a parameter value public String getParameter(String key, String def) { return isStandalone ? System.getProperty(key, def) : (getParameter(key) != null ? getParameter(key) : def); } //Construct the applet public Client() { } //Initialize the applet public void init() { try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } //Component initialization private void jbInit() throws Exception { this.setSize(new Dimension(400,300)); //this.setBackground(Color.black); this.getContentPane().add(chatarea); //this.getContentPane().add(loginDialog); // loginDialog.setVisible(true); } //Get Applet information public String getAppletInfo() { return "Applet Information"; } //Get parameter info public String[][] getParameterInfo() { return null; } //static initializer for setting look & feel static { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); } catch(Exception e) { } }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?