Package misc

Examples of misc.CustomFileFilter.addExtension()


   */
  private void chooseExportFile() {
    JFileChooser fileChooser = new JFileChooser(Application.settings.getLastPath());
    CustomFileFilter filter = new CustomFileFilter();
    filter.setDescription("*."+(String)exportLanguages.get(jComboBoxLanguage.getSelectedItem()));
    filter.addExtension((String)exportLanguages.get(jComboBoxLanguage.getSelectedItem()));
    fileChooser.setFileFilter(filter);
    if(fileChooser.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) {
      String filePath = fileChooser.getSelectedFile().getAbsolutePath();
      // Check on extension
      if (!filePath.toLowerCase().endsWith("."+(String)exportLanguages.get(jComboBoxLanguage.getSelectedItem())))
View Full Code Here


    JFileChooser fileChooser = new JFileChooser(this.defaultPath);
    CustomFileFilter filter = new CustomFileFilter();
    String tempFilePath = null;
   
    filter.setDescription("*."+fileType);
    filter.addExtension(fileType);
      fileChooser.setFileFilter(filter);
     
    if(fileChooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
      tempFilePath = fileChooser.getSelectedFile().getAbsolutePath();
      //Save the path as the default one
View Full Code Here

    JFileChooser fileChooser = new JFileChooser(this.defaultPath);
    CustomFileFilter filter = new CustomFileFilter();
    String tempFilePath = null;
   
    filter.setDescription("*."+fileType);
    filter.addExtension(fileType);
      fileChooser.setFileFilter(filter);
     
    if(fileChooser.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) {
      tempFilePath = fileChooser.getSelectedFile().getAbsolutePath();
      //Save the path as the default one
View Full Code Here

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.