How to change the text in the Cancel button of JFileChooser ?

Hello,
In french the standart text in the Cancel button of the JFileChooser class is "Annuler". For a good reason which will be too long to explain, I need to change it by another term.
I tried to create a super class and redefine the CANCEL_SELECTION string, but this does not work. I can't either change it directly because it has the final attribute.
Where does JFileChooser get this word from ? ( I guess it is not hard coded for multilanguage support purpose).
Any help would be appreciated
Gege

I believe the standard Look and feel implementations look in UIManager for a string called FileChooser.cancelButtonText.
Therefore you might be able to change it after you've loaded your LnF by using the following code:
UIManager.put("FileChooser.cancelButtonText", "---change me---");Note that this would change all file choosers in your application.
If you only want to update one type of file chooser you could extend, for example, MetalFileChooserUI and set its cancel button text by overriding installStrings. You'd then need to install this UI on the file chooser you want to change.
There may be an easier way to do this!
Hope this helps.

Similar Messages

  • How to disable the cancel button in InputDialogBox?

    Can someone please tell me how to disable the cancel button in an input dialog box?
    thanks,

    Cross posted: [http://www.coderanch.com/t/487888/Swing-AWT-SWT-JFace/java/disable-cancel-button-input-dialog]

  • WPF: How to change the radio button text background?

    Is there a simple way that we can change the radio button text background? thx!
    JaneC

    If you literally mean the text background.
    It's a contentcontrol.
    You can put whatever you like in it to hold the text.
    As illustrated by my article:
    http://social.technet.microsoft.com/wiki/contents/articles/30173.wpf-tips-radiobutton-alignment.aspx
    Thus:
    <RadioButton Name="rbnIsolated">
    <TextBlock Text="Isolated Storage" Margin="0,-10,0,0" FontSize="22" Background="Pink"/>
    </RadioButton>
    Makes just the text background pink
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • How to change the "ok" button to "update" button

    Hi all
    I update a field of text within a form and i want as  result of the update to change the default button (id = "1") from ok to update the same way it happens when the user enter text in the field. how can i do that through code?
    appreciate the help

    Hi Yechiel,
    You just change the form mode to update
    Regards
    Ad

  • How to use the cancel button in showInputDialog

    um how would i go with overriding the cancel button's deafult function in JOptionPane.showInputDialog?
    in my code:
    package alphaOne;
    * this program takes in a number and gets the factorial of that number
    import javax.swing.*;
    public class Factorial {
         public Factorial() {
               * variables intilization, input is where the option pane puts the data
               * number is teh actucal number entered parsed from string result is
               * where the resutl is stored flag1 is the indicator if the user had
               * entered an integer
              String input;
              int flag1 = 0;
              int number = 0;
              long result = 0;
               * this while loop runs continously unless an integer is entered
              while (flag1 != 1)
                   try {
                        input = JOptionPane
                                  .showInputDialog("Enter the number to be factored, Integer only: ");
                        number = Integer.parseInt(input);
                        flag1 = 1;
                   } catch (NumberFormatException ea) {
                        JOptionPane.showMessageDialog(null,
                                  "The input was not a integer!", "Warning",
                                  JOptionPane.ERROR_MESSAGE);
              result = number;
              for (int x = 1; x < number; x++) {
                   result = result * (x);
              JOptionPane.showMessageDialog(null, "The result is: " + result,
                        "Result", JOptionPane.CLOSED_OPTION);
              try {
                   System.exit(0);
              } catch (SecurityException ea) {
                   System.out.print("ARRRRR its dead!");
         public static void main(String[] args) {
              Factorial One = new Factorial();
    }the cancel button does not break the while loop

    what is the value of null compared to when you compare it, and do we use the String.equals() or the String == null to compare? as seen in here i tried with input.equals(null) as a comparison but it deos not exit when i press cancel
    package alphaOne;
    * this program takes in a number and gets the factorial of that number
    import javax.swing.*;
    public class Factorial {
         public Factorial() {
               * variables intilization, input is where the option pane puts the data
               * number is teh actucal number entered parsed from string result is
               * where the resutl is stored flag1 is the indicator if the user had
               * entered an integer
              String input;
              boolean flag1 = false;
              int number = 0;
              long result = 0;
               * this while loop runs continously unless an integer is entered
              while (flag1 != true){
                   try {
                        input = JOptionPane
                                  .showInputDialog("Enter the number to be factored, Integer only: ");
                        number = Integer.parseInt(input);
                        System.out.println(input);
                        flag1 = true;
                        if (input.equals(null))
                             try {
                                  System.exit(0);
                             } catch (SecurityException ea) {
                                  System.out.print("ARRRRR its dead!");
                   } catch (NumberFormatException ea) {
                        JOptionPane.showMessageDialog(null,
                                  "The input was not a integer!", "Warning",
                                  JOptionPane.ERROR_MESSAGE);
              result = number;
              for (int x = 1; x < number; x++) {
                   result = result * (x);
              JOptionPane.showMessageDialog(null, "The result is: " + result,
                        "Result", JOptionPane.INFORMATION_MESSAGE);
              try {
                   System.exit(0);
              } catch (SecurityException ea) {
                   System.out.print("ARRRRR its dead!");
         public static void main(String[] args) {
              Factorial One = new Factorial();
    }i have also tried to ue input == null, input == "", input.equals(""), input.equals(" ")
    Message was edited by:
    TheHolyLancer
    i edited the part so it is bold
    Message was edited by:
    TheHolyLancer

  • How to change the defaultCellEditor to a JFileChooser

    i am currently making a table that require input of a file name. for the sake of easy use, i plan to use fileChooser to replace default hardcode editor. when the user click on a cell, fileChooser (my CellEditor) will popup automatically to prompt user to choose a specific file type. As the topic, i am not quite sure how to change the defaultCellEditor to implement as a JFileChooser. So can anyone help me a bit, thx a lot!!!

    i am currently making a table that require input of a
    file name. for the sake of easy use, i plan to use
    fileChooser to replace default hardcode editor. when
    the user click on a cell, fileChooser (my CellEditor)
    will popup automatically to prompt user to choose a
    specific file type. This is covered in the Java Tutorial.
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#editor

  • How to disable the cancel button in the ProgressMonitor

    hi,
    I need to know, is there any way to disable/remove the (cancel)button in the ProgressMonitor?
    One more problem is,
    Once i click the cancel button, isCanceled() return true, how to make it false again so that the process continue....
    It is very urgently.....
    please help me out.
    Thanks in advance.
    Regards,
    Deepa Raghuraman

    I don't think that's a good solution, because Cancel button itself is not disabled, so user is tempted to click it and nothing happens.
    A better but dangerous solution is this:
    progressMonitor = new ProgressMonitor(ProgressMonitorDemo.this,
                                         "Running a Long Task",
                                         "", 0, 100);
    progressMonitor.setMillisToDecideToPopup(0);
    progressMonitor.setMillisToPopup(0);
    progressMonitor.setProgress(0);
    JDialog dialog = (JDialog)progressMonitor.getAccessibleContext().getAccessibleParent();
    JOptionPane pane = (JOptionPane)dialog.getContentPane().getComponent(0);
    pane.setOptions(new Object[]{});Refer to the same question here [http://stackoverflow.com/questions/512151/how-do-i-disable-the-cancel-button-when-using-javax-swing-progressmonitor] .

  • How to change the Icon for a JFileChooser ?

    Has anyone figured out how to change the icon for an instance of JFileChooser from the coffee cup to something else?
    I'm on 1.4
    Thanks,
    Ken

    Never mind. I figured it out.
    You have to use an instance of JFrame in the call to showXxxxDialog(Component c). Set the icon of the JFrame to what you want the JFileChooser's icon to be.

  • How to change the search button to find person

    Hi All,
    I have one page in which i add people search portlet.It work very nice but problem is here I want to change the 'search' to 'find person' .Can any one tell me how to change the 'search' to find person.pls help me how to do that

    Hi All,
    I have one page in which i add people search portlet.It work very nice but problem is here I want to change the 'search' to 'find person' .Can any one tell me how to change the 'search' to find person.pls help me how to do that

  • How to change the TOC button?

    Hi!
    I´d like to change the TOC button. In former versions its simply with four lines on it, with version 8 it´s labeled with "TOC". Can I get the lines back??
    And how do I change the label for bookmarks? (right beside the small bookmark icon it says "title", but I´d like to label it "content" or something else)
    Thanks!

    Still don´t know how to change the label for bookmarks in TOC ...
    But I found the solution for changing the TOC button: somewhere in the program folder are FLA-files for the different skins. Choose the FLA corresponding to your selected skin, open it with Flash and check the library for the button you want to change. Doubleclick in the library and create anew (I changed the "TOC" into three lines). Export SWF and then take care to put it where the original skin SWF is located. Voilá!
    Hopefully someone can tell me a way to change the label ;-)

  • How to handle the "cancel" button and "close" icon of a popup ?

    Hi,
    I have a popup with "cancel button" and "close icon"(on the top right corner of the popup), I want the same operations to be performed on clicking of any of these two components.
    Is there a way to handle such situation ?
    I read about 2 cases to look into this but they didn't work too well for me.
    1. I read about the "popcancellistener" but that listener is called whenever the popup closes, so suppose I have an "ok button" on the popup to create a record, after the record is created, the popup closes and goes into the "popcancellistener", now the question is "how do we know if it came there because of the 'ok button' or 'some other event'".
    2. I even checked the "DialogListener", now I'm able to distinguish between the 'OK' and 'CANCEL' button in the dialoglistener using the "Dialog.Outcome.ok/cancel", but when a user clicks on the close icon, we do not enter the "DialogListener" at all, so in this case "how do we handle the close icon click event"
    Do let me know if you need any more information from my side.
    Thanks for the help in advance.

    The following mechanism responds to any of the following events: <Esc> key, Close icon ('x'), Cancel button
    JavaScript part:
    function popupClosedListener(event){
                  var source = event.getSource();
                  var popupId = source.getClientId();
                  var params = {};
                  params['popupId'] = popupId;
                  var type = "serverPopupClosed";
                  var immediate = true;
                  AdfCustomEvent.queue(source, type, params, immediate);
    }JSF part:
             <af:popup ....>
                  <af:clientListener method="popupClosedListener"
                                           type="popupClosed"/>
                  <af:serverListener type="serverPopupClosed"
                                          method="#{myBean.serverPopupClosedMetod}"/>
            </af:popup>Finally, Java part:
    public void serverPopupClosedMetod(ClientEvent event){
    }

  • How to enable the "Cancel button" so you can stop a report while loading ...

    I have seen that some reports have a Cancel button located just below "the loading ..".
    How can I enable that button in MS Reporting service 2005?

    The following mechanism responds to any of the following events: <Esc> key, Close icon ('x'), Cancel button
    JavaScript part:
    function popupClosedListener(event){
                  var source = event.getSource();
                  var popupId = source.getClientId();
                  var params = {};
                  params['popupId'] = popupId;
                  var type = "serverPopupClosed";
                  var immediate = true;
                  AdfCustomEvent.queue(source, type, params, immediate);
    }JSF part:
             <af:popup ....>
                  <af:clientListener method="popupClosedListener"
                                           type="popupClosed"/>
                  <af:serverListener type="serverPopupClosed"
                                          method="#{myBean.serverPopupClosedMetod}"/>
            </af:popup>Finally, Java part:
    public void serverPopupClosedMetod(ClientEvent event){
    }

  • How to change the menu button picture?

    Hi,
    How can I change the picture (or the 'movie frame') that appears in the sub-chapter menu buttons (those that link directly to different movies) in Encore CS5? By dedfault there appears the first frame from the sequence which in my case is black as I start my sequences with 'dip to black' dissolves. So, all of my sub-chapter menu buttons have black pictures as a result of that. I don't want to animate them, I just want to learn how to pick a frame from the sequence and turn it into a menu button picture.
    Thanks

    Dear Ann and Bill,
    Thanks a lot for your help!
    Unfortunately, I can mark only one answer as correct and I decided to give advantage to Ann as her reply was first and she is a lady.
    I know Bill will not mind.
    Regards,
    Igor

  • How to change the Entourage button to Outlook at the bottom of the iPhoto screen?

    i upgraded from Office for Mac 2008 to 2011. But the e-mail buttom at the bottom of the iPhoto screen still reads Entourage. When I try to e-mail a photo, 2008 opens up,; the seledted photo does not go to 2011. How to change this?

    Have you tried renaming Outlook to Entourage to see if that will work?
    OT

  • How to change the behaviour of the Cancel-Button of SSO-Login-Page (Forms)?

    Hi Folks,
    we use SSO-Login to authenticate users using Forms. How do I change the URL which is opened when a user clicks on the cancel button on the SSO Login page?
    In the formsweg.cfg file there is a parameter named ssoCancelUrl, but if I define it, it doesn't work anyway. Seems like it has something to do with ssoDynamicResourceCreate, but I don't exactly understand what.
    Can't I simply change the URL which is opened (globally), when a user hits the cancel button on any SSO-Loginpage.
    Thanks in advance.
    Regards.

    Exactly this does not work! Please watch my settings:
    Global Setting in formsweb.cfg
    # Single Sign-On OID configuration parameter: indicates whether we allow
    # dynamic resource creation if the resource is not yet created in the OID.
    ssoDynamicResourceCreate=false
    # Single Sign-On parameter: URL to redirect to if ssoDynamicResourceCreate=false
    ssoErrorUrl=
    # Single Sign-On parameter: Cancel URL for the dynamic resource creation DAS page.
    ssoCancelUrl=
    # Single Sign-On parameter: indicates whether the url is protected in which
    # case mod_osso will be given control for authentication or continue in
    # the FormsServlet if not. It is false by default. Set it to true in an
    # application-specific section to enable Single Sign-On for that application.
    ssoMode=false
    App-Specific settings in formsweb.cfg
    [proz]
    envFile=proz.env
    form=proz.fmx
    title=proz
    separateFrame=true
    width=1280
    height=960
    ssoMode=true
    ssoDynamicResourceCreate=false
    ssoCancelURL=http://machinename:port/zugangsportal/
    otherparams=useSDI=yes P_SERVER_URL=machinename:port P_REP_SERVERNAME=machinename_proz ZP_TARGET_ID=%ZP_TARGET_ID%
    When I now access http://machinename:port/forms/frmservlet?config=proz I got redirected to the SSO-Login-Page but the Cancel-Button still links to Middletier Home. Why?
    Regards.

Maybe you are looking for

  • MySQL installation in Snow Leopard Server appears to be broken?

    I tried sudo gem install mysql -- --with-mysql-config=/usr/bin/mysql_config and it failed. The mkmf.log said (in part): "gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -DXOPENSOU

  • Multiple exams in one project and variable

    Hello captivators, How do I make a captivate project with multiple exams. And with variables (widgets) that I need in the whole project. In the intro of the project you can select a character. That selected person is the visual coach (different brand

  • 8.0.2 update and Template issues

    Here's an FYI & observation after the update to 8.0.2. My machine has both Logic Studio and Logic Express installed. After the software update yesterday, Logic Express startups up by presenting the templates dialog box offering all the templates as w

  • Mapping Array string response from Web service

    Hi Need to map the response from a sync call to a WS which contains an array of strings the response message looks like: - <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns

  • Jaxp underlying sax class question

    Below is a class that uses the JAXP layer and parses a xml document. All works fine and my results are proper. I would like to use the JAXP abstraction in some code at work, but I am not sure of two things. 1) What underlying parser does this use.? I