📄 runclient.java
字号:
import java.io.IOException;
/**
* author sunringove
* data 2007-01-17
*
*/
public class RunClient {
/**
* @param args
* @throws ClassNotFoundException
* @throws IOException
* @throws InterruptedException
*/
public static void main(String[] args) throws IOException, ClassNotFoundException, InterruptedException {
LoginFrame lf=new LoginFrame();
Client client=new Client();
String string;
String name;
String passWord;
String nowOperator;
int index;
Member member[];
ManagerFrame mf;
lf.setVisible(true);
string=client.receiveString();
client.sendString("connected");
while(!string.equals("vertify")){
while(!lf.hasActive()){
}
name=lf.getName();
passWord=lf.getPassWord();
client.sendString(name);
client.sendString(passWord);
string=client.receiveString().toString();
if(!string.equals("vertify")){
lf.gotoAlterPage();
lf.resetInput();
client.sendString("erro");
}
else{
lf.gotoVertifyPage();
client.sendString("Legel user");
}
}
lf.setVisible(false);
index=Integer.parseInt(client.receiveString());
member=new Member[index];
member=client.receiveObject();
mf=new ManagerFrame(member,index);
mf.setVisible(true);
while(true){
while(!mf.hasActive()){
}
mf.setActiveFalse();
nowOperator=mf.getNowOperate();
client.sendString(nowOperator);
//响应界面的操作
if(nowOperator.equals("查找")){
client.sendString(mf.getsearchKey());
client.sendString(mf.getsearchValue());
}
if(nowOperator.equals("删除")){
client.sendObject(mf.getMember());
}
if(nowOperator.equals("刷新")){
}
if(nowOperator.equals("添加")){
client.sendObject(mf.getMember());
}
if(nowOperator.equals("修改")){
client.sendString(mf.getdelID());
client.sendObject(mf.getMember());
}
mf.setVisible(false);
member=client.receiveObject();
index=Integer.parseInt(client.receiveString());
mf=new ManagerFrame(member,index);
mf.setVisible(true);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -