home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / sun / applet / AppletViewer$2.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.9 KB  |  48 lines

  1. package sun.applet;
  2.  
  3. import java.awt.Dialog;
  4. import java.awt.FileDialog;
  5. import java.io.File;
  6. import java.io.FileOutputStream;
  7. import java.io.IOException;
  8. import java.io.ObjectOutputStream;
  9. import java.security.PrivilegedAction;
  10.  
  11. class AppletViewer$2 implements PrivilegedAction {
  12.    // $FF: synthetic field
  13.    private final AppletViewer this$0;
  14.  
  15.    AppletViewer$2(AppletViewer var1) {
  16.       this.this$0 = var1;
  17.    }
  18.  
  19.    public Object run() {
  20.       this.this$0.panel.sendEvent(4);
  21.       FileDialog var1 = new FileDialog(this.this$0, AppletViewer.access$100().getMessage("appletsave.filedialogtitle"), 1);
  22.       var1.setDirectory(System.getProperty("user.dir"));
  23.       var1.setFile(AppletViewer.access$200());
  24.       ((Dialog)var1).show();
  25.       String var2 = var1.getFile();
  26.       if (var2 == null) {
  27.          this.this$0.panel.sendEvent(3);
  28.          return null;
  29.       } else {
  30.          String var3 = var1.getDirectory();
  31.          File var4 = new File(var3, var2);
  32.  
  33.          try {
  34.             FileOutputStream var5 = new FileOutputStream(var4);
  35.             ObjectOutputStream var6 = new ObjectOutputStream(var5);
  36.             this.this$0.showStatus(AppletViewer.access$100().getMessage("appletsave.err1", this.this$0.panel.applet.toString(), var4.toString()));
  37.             var6.writeObject(this.this$0.panel.applet);
  38.          } catch (IOException var11) {
  39.             System.err.println(AppletViewer.access$100().getMessage("appletsave.err2", var11));
  40.          } finally {
  41.             this.this$0.panel.sendEvent(3);
  42.          }
  43.  
  44.          return null;
  45.       }
  46.    }
  47. }
  48.