private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
char[] pass = pass1.getPassword();
String passString = new String(pass);
String l = "1;"+jTextField1.getText()+"/"+passString+"/";
try{
a.connection_send(l);
\\HEREEE : I want to wait here 2 secondes before continue and doing a.connection_get()
loginInfo = a.connection_get();
if(Integer.parseInt(loginInfo) == 1) {
home_page a = new home_page();
a.setBounds(500, 200, 470, 330);
} else {
JOptionPane.showMessageDialog(null, "Wrong UserName or Password", "Alert !", JOptionPane.WARNING_MESSAGE);
jTextField1.setText("");
pass1.setText("");
}
} catch(Exception e) {
JOptionPane.showMessageDialog(null, "You Are not connected to Server !\nPlease check Your netowrk ", "Alert !", JOptionPane.WARNING_MESSAGE);
}
}
如何在下面的代码中设置计时器..我标记了我想放置一个小计时器的位置..有什么想法吗?我的目标是稍等片刻,直到服务器准备好向我发送数据……这样我才能接收到正确的数据!