View Single Post
Join Date: Feb 2006
Posts: 2,280
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 242
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

Re: JPAnel need clean sweaping

 
0
  #6
Nov 19th, 2008
Yes, but what contains "mainPanel"? And how is mainPanel added to that container. Or is "mainPanel" the contentPane?

I have a more involved possibility but it involves the component that contains "mainPanel" more than it does "mainPanel" itself.

But, since you're saying that your adding "premade" Panels to mainPanel, then try this, as well:

  1. Dimension d = mainPanel.getSiez();
  2. mainPanel.removeAll();
  3. mainPanel.add(addEP);
  4. addEP.setPreferredSize(d);
  5. addEP.setSize(d);
  6. mainPanel.setPreferredSize(d);
  7. mainPanel.setSize(d);
  8. validate();
(and, if that works, you should probably be able to remove the two mainPanel.set*Size calls, but try including them, first).
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote