📄 makecall.java
字号:
package Client;
import javax.swing.JOptionPane;
import javax.swing.JLabel;
public class MakeCall {
public void dial(String messages,JLabel state)
{
try{
con = new NetCon(JOptionPane.showInputDialog("give the take away shop ip addr,please!"));
state.setText("connecting");
con.send(messages);
isBusy = con.receive();
}catch(Exception e)
{
JOptionPane.showConfirmDialog(null,"connection err!","err!",JOptionPane.OK_OPTION);
con.close();
state.setText("cannot connect!");
return;
}
if(isBusy.equals("001"))
{
JOptionPane.showConfirmDialog(null,"the take shop is busy,please connection later!","busying!",JOptionPane.OK_OPTION);
con.close();
state.setText("is busy,please dial later!");
}else
{
JOptionPane.showConfirmDialog(null,"you are connecting the take away shop!","ok!",JOptionPane.OK_OPTION);
con.close();
state.setText("connection!");
}
}
private NetCon con;
private String isBusy;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -