1. JDialog goes behind after progressbar finishes stackoverflow.comI have |
2. JProgressBar inside a JDialog java-forums.orgpublic void run() { setVisible(true); } public void viewProgress() { try { CheckersClient client = new CheckersClient(serverIP, port); client.connect(); progressBar.setIndeterminate(false); progressBar.setValue(50); statusLabel.setText("Connected, login with username..."); if (client.login(userName) == CheckersDataLogin.SERVER_LOGIN_SUCCESSFUL) { progressBar.setValue(100); statusLabel.setText("Login process completed"); //new Thread(client).start(); setVisible(false); } } catch (InvalidLoginException e) { System.out.println(e.toString()); } catch (Exception e) { System.out.println("Couldn't connect to server."); } } |