Cleared a bug with JScrollPane and dynamically changing GUI fields.

This commit is contained in:
Marcel Kronfeld
2009-10-20 17:15:58 +00:00
parent 2819e9c170
commit 0416188dd6
2 changed files with 3 additions and 4 deletions

View File

@@ -174,13 +174,12 @@ public class GOEPanel extends JPanel implements ItemListener {
setLayout(new BorderLayout());
add(m_ObjectChooser, BorderLayout.NORTH); // important
add(m_ChildPropertySheet, BorderLayout.CENTER);
// add(m_ChildPropertySheet, BorderLayout.CENTER);
// Since we resize to the size of the property sheet, a scrollpane isn't
// typically needed (O Rly?)
JScrollPane myScrollPane =new JScrollPane(m_ChildPropertySheet,JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
myScrollPane.setBorder(null);
add(myScrollPane, BorderLayout.CENTER);
JPanel okcButs = new JPanel();
okcButs.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

View File

@@ -737,9 +737,9 @@ public class PropertySheetPanel extends JPanel implements PropertyChangeListener
}// end if (m_Editors[i] == editor) {
} // end for (int i = 0 ; i < m_Editors.length; i++) {
if (doRepaint) { // some components have been hidden or reappeared
// MK this finally seems to work right
// MK this finally seems to work right, with a scroll pane, too.
Container p=this;
while (p != null) {
while (p != null && (!p.getSize().equals(p.getPreferredSize()))) {
p.setSize(p.getPreferredSize());
p = p.getParent();
}