mgarin / weblaf

WebLaF is a fully open-source Look & Feel and component library written in pure Java for cross-platform desktop Swing applications.
http://weblookandfeel.com
GNU General Public License v3.0
1.14k stars 235 forks source link

JFileChooser's dialogTypes behave different for WebLAF and the standard LaFs. #215

Open michaelriedel opened 9 years ago

michaelriedel commented 9 years ago

When opening a JFileChooser with dialogType set to CUSTOM_DIALOG, the standard LaFs show a text field where the user can enter/edit a filename. With WebLaF, the file name is unmodifiable.

Code to reproduce:

public class WeblafTest
{
   public static void main(String[] args)
   {
      javax.swing.SwingUtilities.invokeLater(WeblafTest::createAndShowGUI);
   }

   private static void createAndShowGUI()
   {
      WebLookAndFeel.install();

      JFrame frame = new JFrame("WeblafTest");
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

      JButton labelSave = new JButton("Save File Chooser");
      labelSave.addActionListener(
            (event) -> {
               JFileChooser chooser = new JFileChooser();
               chooser.showSaveDialog(labelSave);
            }
      );
      frame.getContentPane().setLayout(new FlowLayout());
      frame.getContentPane().add(labelSave);

      JButton labelOpen = new JButton("Open File Chooser");
      labelOpen.addActionListener(
            (event) -> {
               JFileChooser chooser = new JFileChooser();
               chooser.showOpenDialog(labelOpen);
            });
      frame.getContentPane().add(labelOpen);

      JButton labelCustom = new JButton("Custom File Chooser");
      labelCustom.addActionListener(
            (event) -> {
               JFileChooser chooser = new JFileChooser();
               chooser.showDialog(labelCustom, "Do it!");
            }
      );
      frame.getContentPane().add(labelCustom);

      frame.pack();
      frame.setVisible(true);
   }
}
mgarin commented 9 years ago

Thanks for reporting! Fix for this one will also be included into v1.29 release.

michaelriedel commented 9 years ago

You're welcome. Thanks for fixing the bug...