java simple problem - uses cookies. By continuing to browse this site you are agreeing to our use of cookies. Click here to find out more x
Post Reply  
Thread Tools Search this Thread
03-07-2006, 15:38   #1
Registered User
Join Date: Jun 2006
Posts: 36
java simple problem

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.

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");
String[] filterExt = { "*.xml" };

pjfogarty is offline  
05-07-2006, 15:36   #2
Registered User
timeout's Avatar
Join Date: Nov 2001
Location: Galway - Dublin
Posts: 904
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.
timeout is offline  
05-07-2006, 15:42   #3
Registered User
Hobbes's Avatar
Join Date: Feb 1998
Location: Dublin
Posts: 20,767
You would be quicker creating your own dialog.
Hobbes is offline  
05-07-2006, 16:45   #4
Dr Pepper
Registered User
Dr Pepper's Avatar
Join Date: Nov 2003
Location: Dunboyne, Meath
Posts: 804
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!
Dr Pepper is offline  
06-07-2006, 16:32   #5
Registered User
GreeBo's Avatar
Join Date: Oct 2003
Posts: 12,763
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?
GreeBo is offline  
Post Reply

Quick Reply
Remove Text Formatting

Insert Image
Wrap [QUOTE] tags around selected text
Decrease Size
Increase Size
Please sign up or log in to join the discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Share Tweet