Updating JAVA GUI.
There is one action listener class which monitors actions on connect button (present on GUI JPanel).
please see code below
private class ConnectButtonActionListener implements ActionListener{ @Override public void actionPerformed(ActionEvent ae) { h.ui.showBar(); h.cm.connectToServer(); } }When the user presses the connect button following events happen (please refer code above)
1) h.ui.showBar();
This method is part of class handling GUI of software .It is suppose to display a JProgress bar in south.
This progress bar is just to show that software is in process of connecting to server
2) h.cm.connectToServer();
This method has the code which connects to server .It has other statements but the important one is shown below :
Socket socket=new Socket(ipAddress,portNumber);My problem :
When i press connect button the Progress bar doesnt appear on screen .After connection is timed out and connection fails ,the bar appears .
While what should happen is explained above.
My Findings till now :
All i could find till now is that there is some problem happening due to
Socket socket=new Socket(ipAddress,portNumber); statement because if i remove this statement the Bar appears the moment user presses Connect Button.
So what you think is going wrong ?