• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

invisible components

 
Aaron Wilt
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all-
I'm writing a JApplet that has 2 jlabels, 2 jcomboboxs, and 1 jbutton (along with some other lines and rectangles etc). I'm creating these components in my init() method, and adding them to the content pane. I'm not using any layout manager, instead I'm using insets to place them at particular coordinates on the content pane.
When the Japplet loads i can see one of the comboboxs on the screen, yet none of my other components show up. If i click my mouse where i know the button or jcombobox is supposed to be, it magically appears, that is, until my paint method gets called again and it goes away. I'm puzzled.
I've read some places about using validate(), but my understanding is it tells the layoutmanager to re-lay everything out and show it again, but as mentioned before, I'm not using a layout manager (i set it to null).
I cannot seem to figure my problem.. advice would be much appreciated!
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Aaron,
You are missing the obvious: the layout manager might not use a method but it still performs a layout. When you tell your null layout to position itself at 100, 110 who do you think places it there? That's right ... the layout manager!
Regards,
Manfred.
 
Aaron Wilt
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Manfred-
I'm not quite sure I understand.. Does that mean I still need to use the validate() method?
Here's what I have so far... Assume that variables are declared globally.

That should be all the relavant stuff... Sorry if this is a beginning question, but it's really frustrating. Thanks again for helping me!
[ May 01, 2002: Message edited by: Aaron Wilt ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic