Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

java simple problem

  • 03-07-2006 3:38pm
    #1
    Closed Accounts Posts: 36


    Hi,
    I am using a FileDialog dialog and i am wondering if there is a way of changing the text on the buttons,eg change open to something else.I am just using it for selecting a files path by browsing.I am not opening the file,just grabing the path,so something like select would be better.

    eg:
    import org.eclipse.swt.widgets.FileDialog;

    FileDialog out = new FileDialog(shell,SWT.OPEN);
    out.setText("Find or create a file to save output of xslt transform");
    out.setFilterPath("C:/");
    String[] filterExt = { "*.xml" };
    out.setFilterExtensions(filterExt);

    Thanks
    Pj


Comments

  • Registered Users Posts: 919 ✭✭✭timeout


    Well you could subclass it, add a new constructorer and implement that instead. Somebody might have done this already or there might be an alternative method. Just can't think of any right now.


  • Registered Users Posts: 21,264 ✭✭✭✭Hobbes


    You would be quicker creating your own dialog.


  • Registered Users Posts: 839 ✭✭✭Dr Pepper


    JFileChooser has a method called setApproveButtonText for the very thing. Is is possible you could use that instead?
    I'm not familiar with org.eclipse.swt.widgets.FileDialog so couldn't tell ya how to do it with that dialog!


  • Registered Users Posts: 26,985 ✭✭✭✭GreeBo


    yeah, nothing obvious in org.eclipse.swt.widgets.FileDialog or its parents..
    I'd set about extending it, I dont have the code but Im sure the Open button is just some sort of Button object contained within FileDialog, should be easy to entend FileDialog, maybe with a constructor that takes in the button label as a param or something?


Advertisement