JDK-6642612 : JFileChooser approve buttons should use Open and Save text (GTK)
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2007-12-17
  • Updated: 2011-05-18
  • Resolved: 2011-05-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b27Fixed
Description
FULL PRODUCT VERSION :
$ java -version
java version "1.6.0_02-ea"
Java(TM) SE Runtime Environment (build 1.6.0_02-ea-b02)
Java HotSpot(TM) Server VM (build 1.6.0_02-ea-b02, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Linux crux 2.6.18-5-686-bigmem #1 SMP Wed Oct 3 01:22:56 UTC 2007 i686 GNU/Linux

A DESCRIPTION OF THE PROBLEM :
The text in the approve buttons for JFileChooser (in the GTK L&F at
least) should be Open for showOpenDialog and Save for showSaveDialog,
not just OK.

The buttons should also be the same size.

There are, of course, many, many differences with the current GTK file
chooser dialog, but that's enough for this report.


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run attached program (you need the Swing Application Framework, JSR 296).
Cancel dialogs that appear.
View approve button to the right of the Cancel button.


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javax.swing.JFileChooser;

import org.jdesktop.application.Application;
import org.jdesktop.application.SingleFrameApplication;

public class GtkJFileChooserApproveButtonBug extends SingleFrameApplication {

    public GtkJFileChooserApproveButtonBug() {
    }

    @Override
    protected void startup() {
        new JFileChooser().showOpenDialog(null);
        new JFileChooser().showSaveDialog(null);
    }

    public static void main(String args[]) {
        Application.launch(GtkJFileChooserApproveButtonBug.class, args);
    }
}

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
You would think that calling

fileChooser.setApproveButtonText("Open");

for example, would set the text to Open, but it does not.

Comments
EVALUATION We have to do "Ok" and "Cancel" buttuns with the same size.
29-12-2007