java Sockets and Threads Problem

Posted by vs4vijay on Stack Overflow See other posts from Stack Overflow or by vs4vijay
Published on 2010-06-05T17:35:00Z Indexed on 2010/06/05 17:42 UTC
Read the original article Hit count: 124

Filed under:
|
|
|
|

I am doin a Some Socket Programing Stuff in Java.. Here i have created a button(Create Server)..and when i click it ,it starts server...but i want to change the button name to (Stop Server) after Starting the server... so i did this.. but when i press start server it starts and the button name remains the same...

and when a client gets connected to it ,then it change the name to stop server...

tell me whats the wrong with this code??

Here is My a SomePart Of Code...

public void actionPerformed(ActionEvent ex)
{
    if(ex.getActionCommand() == "CreateServer")
    {
        bt1.setText("Stop Server");
        bt2.setEnabled(false);
        b5.setText("Server Started On Port " + tf2.getText());      
        System.out.println("Server started 1");
            create(Integer.parseInt(tf2.getText()));  //my func. to create server
        System.out.println("Server started 2");
    }       
}

and my create() fucn. contains some sockets and thread...so tell me what the problem...

© Stack Overflow or respective owner

Related posts about java

Related posts about sockets