Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Gayed2004-03-05 15:20:12 +0000
committerGrant Gayed2004-03-05 15:20:12 +0000
commit194092c1ba2d886ec081bb7f6d5cdf0fc39ff561 (patch)
treee492e5de9233c0eab7780741f7713516afbecf0f /examples
parent70b22a85d0ed71ad385ad17eceedd496087671d4 (diff)
downloadeclipse.platform.swt-194092c1ba2d886ec081bb7f6d5cdf0fc39ff561.tar.gz
eclipse.platform.swt-194092c1ba2d886ec081bb7f6d5cdf0fc39ff561.tar.xz
eclipse.platform.swt-194092c1ba2d886ec081bb7f6d5cdf0fc39ff561.zip
53221
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java
index 7b7f400061..a006562a12 100755
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java
@@ -980,7 +980,14 @@ public class ImageAnalyzer {
// Get the user to choose a file name and type to save.
FileDialog fileChooser = new FileDialog(shell, SWT.SAVE);
fileChooser.setFilterPath(lastPath);
- if (fileName != null) fileChooser.setFileName(fileName);
+ if (fileName != null) {
+ String name = fileName;
+ int nameStart = name.lastIndexOf(java.io.File.separatorChar);
+ if (nameStart > -1) {
+ name = name.substring(nameStart + 1);
+ }
+ fileChooser.setFileName(name);
+ }
fileChooser.setFilterExtensions(new String[] { "*.bmp", "*.gif", "*.ico", "*.jpg", "*.png" });
fileChooser.setFilterNames(new String[] { "BMP (*.bmp)", "GIF (*.gif)", "ICO (*.ico)", "JPEG (*.jpg)", "PNG (*.png)" });
String filename = fileChooser.open();

Back to the top