View Single Post
Join Date: Feb 2006
Posts: 2,281
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: 243
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

Re: JPAnel need clean sweaping

 
0
  #2
Nov 19th, 2008
The problem is that the panel will only cover as much area as it needs. Anything beyond this area is "ignored" during a validate on the panel (since that area no longer "belongs" to the Panel. 2 "quick" possibilites (I would try the second first).

Have you tried
  1. Dimension d = mainPanel.getSiez();
  2. mainPanel.removeAll();
  3. mainPanel.add(addEP);
  4. mainPanel.setPreferredSize(d);
  5. mainPanel.setSize(d);
  6. validate();
or
  1. mainPanel.removeAll();
  2. mainPanel.add(addEP);
  3. mainPanel.getParent().validate();
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