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!
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.
posted 18 years ago
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 ]
Tick check! Okay, I guess that was just an itch. Oh wait! Just a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!