-
Bug
-
Resolution: Fixed
-
P5
-
1.1.8
-
None
-
b04
-
generic
-
windows_nt
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2026234 | 1.3.0 | Michael Martak | P5 | Resolved | Fixed | kestrel |
JDK-2026233 | 1.2.2_002 | Michael Martak | P5 | Resolved | Fixed | b02 |
JDK-2026232 | 1.2.1_002 | Michael Martak | P5 | Resolved | Fixed | b02 |
JDK-2026231 | 1.1.8_001 | Michael Martak | P5 | Resolved | Fixed | b01 |
The test case shows a frame with a button (A).
Push A and a modal dialog with button (B) is created.
Resize the dialog and then push B to hide it.
Push A again to reshow the dialog (should be packed back to original size).
Push B again to hide and then A to reshow.
In the jdk117fcs and jdk118L the dialog is usually resized correctly, but on second time, the button
changes to the small square. 1.2 is the same as 118 except that the background of the dialog is not painted.
(Using JDK116's the modal dialog (B) is usually left at the size the user resized to, as well as the button being a small square in the top left).
import java.awt.*;
import java.awt.event.*;
public class Test {
public static void main(String args[]) {
final Frame f = new Frame("1");
final Dialog d = new Dialog(f, "2", true);
final Button b2 = new Button("B");
b2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
d.setVisible(false);
}
});
d.setLayout(new BorderLayout());
d.add(b2, BorderLayout.CENTER);
//d.setLayout(new GridLayout(1, 1));
//d.add(b2);
Button b = new Button("A");
f.add(b, BorderLayout.CENTER);
b.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("Button pref size " + b2.getPreferredSize());
System.out.println("Dialog pref size " + d.getPreferredSize());
d.pack();
d.setVisible(true);
}
});
f.pack();
f.setVisible(true);
}
}
The problem appears to be in the preferred size area. LayoutMgr.preferredLayoutSize calls
Component.getPreferredSize which calls WComponentPeer.getPreferredSize which calls
WComponentPeer.getMinimumSize.
The sizes returned are around width=30/height=50 for the dialog, and width=22/height=23 for
the button. The dialog's actual size is around 110 width (presumably this is the minimum
windows size of 112) and does not go below this. However, the button can be sized to 22/23.
Either the minimum size should be based on the minimum physical windows size, or the
components should be size to the actual size of the container.
adele.carrie@ireland 1999-04-01
Push A and a modal dialog with button (B) is created.
Resize the dialog and then push B to hide it.
Push A again to reshow the dialog (should be packed back to original size).
Push B again to hide and then A to reshow.
In the jdk117fcs and jdk118L the dialog is usually resized correctly, but on second time, the button
changes to the small square. 1.2 is the same as 118 except that the background of the dialog is not painted.
(Using JDK116's the modal dialog (B) is usually left at the size the user resized to, as well as the button being a small square in the top left).
import java.awt.*;
import java.awt.event.*;
public class Test {
public static void main(String args[]) {
final Frame f = new Frame("1");
final Dialog d = new Dialog(f, "2", true);
final Button b2 = new Button("B");
b2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
d.setVisible(false);
}
});
d.setLayout(new BorderLayout());
d.add(b2, BorderLayout.CENTER);
//d.setLayout(new GridLayout(1, 1));
//d.add(b2);
Button b = new Button("A");
f.add(b, BorderLayout.CENTER);
b.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("Button pref size " + b2.getPreferredSize());
System.out.println("Dialog pref size " + d.getPreferredSize());
d.pack();
d.setVisible(true);
}
});
f.pack();
f.setVisible(true);
}
}
The problem appears to be in the preferred size area. LayoutMgr.preferredLayoutSize calls
Component.getPreferredSize which calls WComponentPeer.getPreferredSize which calls
WComponentPeer.getMinimumSize.
The sizes returned are around width=30/height=50 for the dialog, and width=22/height=23 for
the button. The dialog's actual size is around 110 width (presumably this is the minimum
windows size of 112) and does not go below this. However, the button can be sized to 22/23.
Either the minimum size should be based on the minimum physical windows size, or the
components should be size to the actual size of the container.
adele.carrie@ireland 1999-04-01
- backported by
-
JDK-2026231 resizing dialogs
- Resolved
-
JDK-2026232 resizing dialogs
- Resolved
-
JDK-2026233 resizing dialogs
- Resolved
-
JDK-2026234 resizing dialogs
- Resolved