Cleared a bug with JScrollPane and dynamically changing GUI fields.
This commit is contained in:
@@ -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));
|
||||
|
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user