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

📄 sketcher.java

📁 一个多播的实现程序
💻 JAVA
字号:
import java.io.*;
import java.net.*;
import java.awt.*;
import java.awt.event.*;

public class Sketcher
{
static SketchFrame window;

public static void main(String[] args)throws IOException
{
//SketchFrame code:
window = new SketchFrame("ChitChat Broadcast Messenger");
Toolkit theKit = window.getToolkit();
Dimension wndSize = theKit.getScreenSize();

window.setBounds(wndSize.width/4,wndSize.height/4,wndSize.width/2,wndSize.height/2);
window.setVisible(true);


if ((args.length != 1) || (args[0].indexOf (':') < 0))
     throw new IllegalArgumentException ("Syntax: ChatClient <host>:<port>");

  int idx = args[0].indexOf (':');
 String host = args[0].substring (0, idx);
 int port = Integer.parseInt (args[0].substring (idx + 1));
 Sketcher sObj = new Sketcher();
 sObj.fun(host,port,window);

}
void  fun(String host,int port,SketchFrame window) throws IOException
{
	 ChatClient client = new ChatClient (host, port, window);
    client.start ();
}
}//End of Sketcher code

⌨️ 快捷键说明

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