callbackimp.java
来自「一个自己做的聊天 的java 网络游戏。。。供大家交流」· Java 代码 · 共 27 行
JAVA
27 行
import java.rmi.*;
import java.rmi.server.*;
public class CallBackImp extends UnicastRemoteObject
implements CallBack
{
private ChatClient thisClient;
public CallBackImp(Object client) throws RemoteException
{
thisClient = (ChatClient) client;
}
public void addMessage(String from, String message)throws RemoteException
{
thisClient.getMessageBox().append("<" + from + ">" + message + "\n");
}
public void quitMessage(String from)throws RemoteException
{
thisClient.getMessageBox().append(from + " has left.\n");
}
public void joinedMessage(String from)throws RemoteException
{
thisClient.getMessageBox().append(from + " has joined.\n");
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?