Package javax.swing.filechooser

Examples of javax.swing.filechooser.FileNameExtensionFilter


  /**
   * Returns the FileFilter for the TinyUML serialized model files.
   * @return the FileFilter
   */
  private FileNameExtensionFilter createModelFileFilter() {
    return new FileNameExtensionFilter(
      "TinyUML serialized model file (*.tsm)", "tsm");
  }
View Full Code Here


   * Exports graphics as SVG.
   */
  private void exportGfx() {
    JFileChooser fileChooser = new JFileChooser();
    fileChooser.setDialogTitle(getResourceString("dialog.exportgfx.title"));
    FileNameExtensionFilter svgFilter = new FileNameExtensionFilter(
      "Scalable Vector Graphics file (*.svg)", "svg");
    FileNameExtensionFilter pngFilter = new FileNameExtensionFilter(
      "Portable Network Graphics file (*.png)", "png");
    fileChooser.addChoosableFileFilter(svgFilter);
    fileChooser.addChoosableFileFilter(pngFilter);
    fileChooser.setAcceptAllFileFilterUsed(false);
    if (fileChooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {
View Full Code Here

  public void setDirty(boolean dirty) {
    this.dirty = dirty;
  }

  public FileNameExtensionFilter getFileFilter() {
    return new FileNameExtensionFilter(fileTypeDescription, fileExtension);
  }
View Full Code Here

   * Exports graphics as SVG.
   */
  private void exportGfx() {
    JFileChooser fileChooser = new JFileChooser();
    fileChooser.setDialogTitle(getResourceString("dialog.exportgfx.title"));
    FileNameExtensionFilter svgFilter = new FileNameExtensionFilter(
      "Scalable Vector Graphics file (*.svg)", "svg");
    FileNameExtensionFilter pngFilter = new FileNameExtensionFilter(
      "Portable Network Graphics file (*.png)", "png");
    fileChooser.addChoosableFileFilter(svgFilter);
    fileChooser.addChoosableFileFilter(pngFilter);
    fileChooser.setAcceptAllFileFilterUsed(false);
    if (fileChooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {
View Full Code Here

        col.setMaxWidth(50);
    }

    public void createNewDatabase(){
        JFileChooser db = null; // FileChooser
        FileNameExtensionFilter filter = new FileNameExtensionFilter(
        "SQLite Database (db, sqlite, sqlite3)", "db", "sqlite", "sqlite3"); // Filter
        File def = null; // Default
        File file = null; // Later
        def = new File(System.getProperty("user.home")+File.separator+".vokabeln"+File.separator);
        if(def.exists()){
View Full Code Here

    }
    public void changeDatabase(String filename, boolean saveRecent){
        File file = null;
        if(filename.equals("")){
            JFileChooser db = new JFileChooser();
            FileNameExtensionFilter filter = new FileNameExtensionFilter(
            "SQLite Database (db, sqlite, sqlite3)", "db", "sqlite", "sqlite3"); // Filter
            db.setFileFilter(filter);
            int state = db.showOpenDialog(this);
            if ( state == JFileChooser.APPROVE_OPTION ){
                file = db.getSelectedFile();
View Full Code Here

    ImagePreviewPanel preview = new ImagePreviewPanel();
    jfc.setAccessory(preview);
    jfc.addPropertyChangeListener(preview);

    jfc.setPreferredSize(WindowUtils.getRelativeScreenDimension(0.7f, 0.6f));
    FileNameExtensionFilter filter = new FileNameExtensionFilter(
       "JPG GIF PNG Images", "jpg", "jpeg", "gif", "png");
    jfc.setFileFilter(filter);
    jfc.setAcceptAllFileFilterUsed(acceptAll);

    if(jfc.showOpenDialog(c) == JFileChooser.APPROVE_OPTION)
View Full Code Here

  public JFileChooser getSqLiteFileChooser(String title, String path) {
    if (sqLiteFileChooser == null) {
     
      sqLiteFileChooser = new JFileChooser();
      sqLiteFileChooser.addChoosableFileFilter(new FileNameExtensionFilter("XBMC SQLite Database", "db", "DB"));
    }
    if (title != null) {
      sqLiteFileChooser.setDialogTitle(title);
    }
    if (path != null) {
View Full Code Here

   */
  PathJPanel(){
   
    this.setLayout(new GridLayout(2,2));
   
    filterAPng = new FileNameExtensionFilter("APng-Images","apng");
    mFileChooser.addChoosableFileFilter(filterAPng);
   
    filterPng = new FileNameExtensionFilter("Png-Images","png");
    mFileChooser.addChoosableFileFilter(filterPng);
   
      filterGif = new FileNameExtensionFilter("Gif-Images","gif");
      mFileChooser.addChoosableFileFilter(filterGif);
     
      mFileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
     
    mButtonSource.addActionListener(new ActionListener(){
View Full Code Here

   */
  PathJPanel(){
   
    this.setLayout(new GridLayout(2,2));
   
      filterPng = new FileNameExtensionFilter("Png-Images","png");
    mFileChooser.addChoosableFileFilter(filterPng);
   
      filterGif = new FileNameExtensionFilter("Gif-Images","gif");
      mFileChooser.addChoosableFileFilter(filterGif);
     
      mFileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
     
    mButtonSource.addActionListener(new ActionListener(){
View Full Code Here

TOP

Related Classes of javax.swing.filechooser.FileNameExtensionFilter

Copyright © 2018 www.massapicom. 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.