• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

JFrame visible - all else invisible.

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...


 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
mooooooo ..... tiny ad ....
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic