Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Replacing a JPanel

843805Apr 19 2007 — edited Apr 20 2007
Hi

In one of the dialogs of my application, I have a JPanel that describes some properties of one of my objects.

The object's properties described by my JPanel can be "empty' (when I have no properties to describe, I put in the JPanel a JLabel saying "No properties inserted" and a JButton "insert properties) or a Box with the properties I want (A vertical Box filled with horizontal Box, the first horizontal Box are JLabels (name, value, limit...) and the second Box are "JTextField"s).

When I have no properties and I press the button "insert properties", I replace the JPanel with a new JPanel with the new Layout.

The problem is that, when I have the button pressed to replace the JPanel, my new JPanel is not painted correctly (everything seems to be painted in the same place, component over component). I've already tested only the new JPanel on a JFrame and it is fine, the problem happens only when I try to replace the panels.

So, can you help me solve my problem?


thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 18 2007
Added on Apr 19 2007
3 comments
233 views