Results 1 to 4 of 4
- 10-07-2009, 01:18 PM #1
Member
- Join Date
- Oct 2009
- Posts
- 1
- Rep Power
- 0
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.
Java 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); } };
Last edited by Fubarable; 10-07-2009 at 06:24 PM. Reason: Code tags added
- 10-07-2009, 01:45 PM #2
Member
- Join Date
- Oct 2009
- Posts
- 16
- Rep Power
- 0
GUI Not Showing
Is it the content of the HTTPServerSim() class that is not showing?
Not sure if this will help, but you can try calling the following two methods at the end of HTTPServerSim's constructor:
this.repaint();
this.validate();
Good luck
- 10-07-2009, 03:10 PM #3
paste the main code and ask.
Ramya:cool:
-
I added code tags to your original post to help make it readable. I've got a concern here:
Java Code:if(command == "Commit"){
Java Code:if(command.equals("Commit")) {
Similar Threads
-
Content type for MS files "content/unknown" with URLConnection
By serjant in forum NetworkingReplies: 2Last Post: 05-30-2009, 10:42 AM -
JTextField not visible?
By McChill in forum New To JavaReplies: 2Last Post: 05-20-2009, 12:17 AM -
Text are not visible in GUI
By VinTiger in forum New To JavaReplies: 5Last Post: 05-15-2009, 08:14 AM -
Tab or Table not visible
By madhuvanthi2312 in forum SWT / JFaceReplies: 1Last Post: 04-25-2009, 09:00 AM -
constructor ... is not visible
By emceenugget in forum New To JavaReplies: 2Last Post: 09-27-2008, 05:12 AM
Bookmarks