GUI is visible but content is not.
:confused:
I have two java classes extending JFrame: HTTPServer.java and Welcome.java. When I run HTTPServer.java with placing public static void main in it. It shows me the perfect GUI with all its content like button,table, etc. But when I call the object of HTTPServer within new ActionListener() in Welcome.java. It is not showing the content within GUI as it is showing the GUI only.
Code:
ActionListener actionListener = new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
String command = actionEvent.getActionCommand();
if(command == "Commit"){
add(mainPanel, BorderLayout.EAST);
int j = 0;
while(selectedServers[j] != -1){
System.out.println(serverOptions[selectedServers[j]] + " ");
j++;
}
new HTTPServerSim();
}
if(command == "Reset")
serverList.clearSelection();
if(command == "Cancel")
System.exit(0);
}
};
Both the java files are within same package.Please help as Iam stuck becoz of this.