• Post Reply Bookmark Topic Watch Topic
  • New Topic

JFrame visible - all else invisible.

 
Paul Kelley
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I figure this is an easy one, but I don't see why my GUI only appears with a JFrame with the title "Java Message Server Information", and everything in the JFrame is transparent (i.e. not there). What I expected to see was 3 JLabels ("IP Address", "Port", "Topic Name"), and their corresponding JTextFields, and at the bottom of the JFrame a JButton labled "Accept" but instead I came up empty.
Can someone help me with this? Sorry if it's obvious, I'm very new to SWING.

Thanks!

Here's the code...


 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


You add panel, which is an empty JPanel to the frame. I don't see where you've added TopicForm to the frame.
 
Paul Kelley
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instantiated TopicForm near top of constructor signature "public TopicGUI()" like this...


Then I add "TopicForm" to the JFrame in the following statement...



I would also presume JPanel to not be empty because of the statment...



Where the variable "submit" was declared previously as...



Thoughts?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see anything wrong with it. If I add the following:



and then run the whole thing as "java TopicGUI", it seems to work perfectly.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!