United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6642612 JFileChooser approve buttons should use Open and Save text (GTK)
JDK-6642612 : JFileChooser approve buttons should use Open and Save text (GTK)

Details
Type:
Bug
Submit Date:
2007-12-17
Status:
Closed
Updated Date:
2011-05-18
Project Name:
JDK
Resolved Date:
2011-05-18
Component:
client-libs
OS:
linux
Sub-Component:
javax.swing
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports

Sub Tasks

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.
                                     
2007-12-29



Hardware and Software, Engineered to Work Together