-
Bug
-
Resolution: Fixed
-
P4
-
17, 19, 20
-
b11
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM:
When JFileChooser is added to a JFrame, the open button is not shown properly. The button size is smaller compared to its actual size. The issue is observed in Metal, Nimbus and Motif look and feel and when custom Dialogue type is set without setting Approve Button Text.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM:
Compile and run the code below under Metal Look and Feel (Default Look and feel in windows and Linux is Metal, whereas in MacOS the look and feel has to be set).
EXPECTED VERSUS ACTUAL BEHAVIOR:
EXPECTED -
The Open button to be seen properly as Cancel button, without reducing its size.
ACTUAL -
The Open button size is smaller compared to its actual size.
---------- BEGIN SOURCE ----------
import java.awt.*;
import javax.swing.*;
public class FileChooserTest {
public static void main(String[] args) throws UnsupportedLookAndFeelException, ClassNotFoundException, InstantiationException, IllegalAccessException {
UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
JFileChooser fc = new JFileChooser();
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
fc.setDialogType(JFileChooser.CUSTOM_DIALOG);
frame.add(fc, BorderLayout.CENTER);
frame.pack();
frame.setVisible(true);
}
}
---------- END SOURCE ----------
FREQUENCY : always
When JFileChooser is added to a JFrame, the open button is not shown properly. The button size is smaller compared to its actual size. The issue is observed in Metal, Nimbus and Motif look and feel and when custom Dialogue type is set without setting Approve Button Text.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM:
Compile and run the code below under Metal Look and Feel (Default Look and feel in windows and Linux is Metal, whereas in MacOS the look and feel has to be set).
EXPECTED VERSUS ACTUAL BEHAVIOR:
EXPECTED -
The Open button to be seen properly as Cancel button, without reducing its size.
ACTUAL -
The Open button size is smaller compared to its actual size.
---------- BEGIN SOURCE ----------
import java.awt.*;
import javax.swing.*;
public class FileChooserTest {
public static void main(String[] args) throws UnsupportedLookAndFeelException, ClassNotFoundException, InstantiationException, IllegalAccessException {
UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
JFileChooser fc = new JFileChooser();
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
fc.setDialogType(JFileChooser.CUSTOM_DIALOG);
frame.add(fc, BorderLayout.CENTER);
frame.pack();
frame.setVisible(true);
}
}
---------- END SOURCE ----------
FREQUENCY : always
- is blocked by
-
JDK-8300084 AquaFileChooserUI.getDefaultButton returns null
- Resolved
-
JDK-8300549 JFileChooser Approve button tooltip is null in Aqua L&F in CUSTOM_DIALOG mode
- Resolved