Replacing a JPanel
843805Apr 19 2007 — edited Apr 20 2007Hi
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