-
Bug
-
Resolution: Fixed
-
P3
-
8, 11, 12, 13
-
b13
-
x86_64
-
windows_10
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8261241 | 13.0.7 | Yuri Nesterenko | P3 | Resolved | Fixed | b02 |
JDK-8243108 | 11.0.8-oracle | Sergey Bylokhov | P3 | Resolved | Fixed | b04 |
JDK-8244784 | 11.0.8 | Sergey Bylokhov | P3 | Resolved | Fixed | b03 |
ADDITIONAL SYSTEM INFORMATION :
Tested under jdk-10 and 12.
A DESCRIPTION OF THE PROBLEM :
Although a JDialog can manually be narrowed to a minimum width of 132, any pro-
grammatically requested dialog width less than 198 is ignored and set to 198.
When running the code example below, one can defer from the asymetric placing of
the dialog, that still somewhere the requested width is taken into into account.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run the code.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
JDialog should have a width of 150.
ACTUAL -
Width is 198.
---------- BEGIN SOURCE ----------
import java.awt.*;
import javax.swing.*;
public class NarrowDialog extends JFrame {
public NarrowDialog() {
setSize(300,350);
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
setLocationRelativeTo(null);
setTitle("JFrame");
setVisible(true);
JDialog dlg= new JDialog(this, "JDialog", true);
dlg.setSize(150, 200);
// dlg.setResizable(false);
/* No change when specifying all sizes.
Dimension dim= new Dimension(150, 200);
dlg.setMaximumSize(dim);
dlg.setMinimumSize(dim);
dlg.setPreferredSize(dim);
*/
dlg.setLocationRelativeTo(this);
dlg.setVisible(true);
System.out.println(dlg.getSize());
}
public static void main(String args[]) {
SwingUtilities.invokeLater(NarrowDialog::new);
}
}
---------- END SOURCE ----------
FREQUENCY : always
Tested under jdk-10 and 12.
A DESCRIPTION OF THE PROBLEM :
Although a JDialog can manually be narrowed to a minimum width of 132, any pro-
grammatically requested dialog width less than 198 is ignored and set to 198.
When running the code example below, one can defer from the asymetric placing of
the dialog, that still somewhere the requested width is taken into into account.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run the code.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
JDialog should have a width of 150.
ACTUAL -
Width is 198.
---------- BEGIN SOURCE ----------
import java.awt.*;
import javax.swing.*;
public class NarrowDialog extends JFrame {
public NarrowDialog() {
setSize(300,350);
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
setLocationRelativeTo(null);
setTitle("JFrame");
setVisible(true);
JDialog dlg= new JDialog(this, "JDialog", true);
dlg.setSize(150, 200);
// dlg.setResizable(false);
/* No change when specifying all sizes.
Dimension dim= new Dimension(150, 200);
dlg.setMaximumSize(dim);
dlg.setMinimumSize(dim);
dlg.setPreferredSize(dim);
*/
dlg.setLocationRelativeTo(this);
dlg.setVisible(true);
System.out.println(dlg.getSize());
}
public static void main(String args[]) {
SwingUtilities.invokeLater(NarrowDialog::new);
}
}
---------- END SOURCE ----------
FREQUENCY : always
- backported by
-
JDK-8243108 Requested JDialog width is ignored
- Resolved
-
JDK-8244784 Requested JDialog width is ignored
- Resolved
-
JDK-8261241 Requested JDialog width is ignored
- Resolved
(1 links to)