...called (Java)? First, I made a swing app with a main method (So it could be made into a .jar executable). This works fine but I now wanted to modify it so that a different class can create the same thing (Through the main method). When a button is pushed on the other swing window the class (SocketServer) is called using SocketServer.main(args); I assumed this would produce the same results as if the program was run by itself since that too uses the main method. The problem is that when the other swing window calls the main method of SocketServer the window comes up like it should but you cannot see any of the components, it looks as though it is frozen but it is not. Now, the only thing I believe can be causing this is that in SocketServer the program loops forever because it is a server and needs to listen/respond forever. The problem with that is that it works fine when running alone, so in theory it should work exactly the same right? Now I didn't know either is if the first swing window takes priority over the new one created so thats why its not going correctly? I have no clue, any help would be appreciated 