Package org.javatari.pc.cartridge

Source Code of org.javatari.pc.cartridge.FileServiceROMChooser

// Copyright 2011-2012 Paulo Augusto Peccin. See licence.txt distributed with this file.

package org.javatari.pc.cartridge;

import javax.jnlp.FileContents;
import javax.jnlp.FileOpenService;
import javax.jnlp.ServiceManager;


public final class FileServiceROMChooser {

  public static FileContents chooseFileToLoad() {
    try {
      FileOpenService fos = (FileOpenService)ServiceManager.lookup("javax.jnlp.FileOpenService");
      FileContents fileCon = fos.openFileDialog(null, ROMLoader.VALID_LOAD_FILE_EXTENSIONS);
      if (fileCon == null) return null;
      return fileCon;
    } catch (Exception ex) {
      System.out.println("File Service Cartridge Chooser: unable to open dialog\n" + ex);
      return null;
    }
  }
 
}
TOP

Related Classes of org.javatari.pc.cartridge.FileServiceROMChooser

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.