Examples of addChoosableFileFilter()


Examples of javax.swing.JFileChooser.addChoosableFileFilter()

     *
     * @return a file to read or null to cancel.
     */
    public File promptForFile(FileFilter fileFilter) {
        JFileChooser chooser = new JFileChooser();
        chooser.addChoosableFileFilter(fileFilter);

        if (chooser.showSaveDialog(parent) != JFileChooser.APPROVE_OPTION) {
            return null;
        }

View Full Code Here

Examples of javax.swing.JFileChooser.addChoosableFileFilter()

    JFileChooser fileChooser = new JFileChooser();
    fileChooser.setLocale(this.getLocale());
    fileChooser.updateUI();
    for(int i = 0; i < saveContributors.size(); i++)
    {
      fileChooser.addChoosableFileFilter((JRSaveContributor)saveContributors.get(i));
    }

    if (saveContributors.contains(lastSaveContributor))
    {
      fileChooser.setFileFilter(lastSaveContributor);
View Full Code Here

Examples of javax.swing.JFileChooser.addChoosableFileFilter()

            javax.swing.filechooser.FileFilter[] fft = p.getFileFilters(action);
            if (fft == null) {
                continue;
            }
            for (int j = 0; j < fft.length; ++j) {
                fileChooser.addChoosableFileFilter(fft[j]);
                if (firstFilter == null) {
                    firstFilter = fft[j];
                }
            }
        }
View Full Code Here

Examples of javax.swing.JFileChooser.addChoosableFileFilter()

        fileChooser.setAcceptAllFileFilterUsed(false); // don't want all file
        // filters in aggregate
        AggregateFileFilter agf = null;
        if (action == Plugin.OPEN) {
            agf = new AggregateFileFilter(fileChooser.getChoosableFileFilters());
            fileChooser.addChoosableFileFilter(agf);
        }
        // Add an accessory panel
        fileChooser.setAccessory(new FileChooserAccessory(action));

        fileChooser.setMultiSelectionEnabled(action == Plugin.OPEN);
View Full Code Here

Examples of javax.swing.JFileChooser.addChoosableFileFilter()

  {
    JFileChooser fileChooser = new JFileChooser(
      inputPath + java.io.File.separator + "pdf"
      );
    fileChooser.setDialogTitle("Open PDF file");
    fileChooser.addChoosableFileFilter(new PdfFileFilter());
    switch(fileChooser.showDialog(null, "Open"))
    {
      case JFileChooser.APPROVE_OPTION:
        File file = fileChooser.getSelectedFile();
View Full Code Here

Examples of javax.swing.JFileChooser.addChoosableFileFilter()

    class OpenItemListener implements ActionListener {
  public void actionPerformed(ActionEvent e) {
      File mediaFile = null;

      JFileChooser chooser = new JFileChooser(getChooserRoot());
      chooser.addChoosableFileFilter(new MixFileFilter());

      int rc = chooser.showOpenDialog(SimpleMixer.this);

      if (rc == JFileChooser.APPROVE_OPTION) {
    mediaFile = chooser.getSelectedFile();
View Full Code Here

Examples of javax.swing.JFileChooser.addChoosableFileFilter()

    //
    class SaveItemListener implements ActionListener {
  public void actionPerformed(ActionEvent e) {
      File trackFile = null;
      JFileChooser chooser = new JFileChooser(getChooserRoot());
      chooser.addChoosableFileFilter(new MixFileFilter());
      chooser.addChoosableFileFilter(new HTMLFileFilter());

      int rc = chooser.showSaveDialog(SimpleMixer.this);

      if (rc == JFileChooser.APPROVE_OPTION) {
View Full Code Here

Examples of javax.swing.JFileChooser.addChoosableFileFilter()

    class SaveItemListener implements ActionListener {
  public void actionPerformed(ActionEvent e) {
      File trackFile = null;
      JFileChooser chooser = new JFileChooser(getChooserRoot());
      chooser.addChoosableFileFilter(new MixFileFilter());
      chooser.addChoosableFileFilter(new HTMLFileFilter());

      int rc = chooser.showSaveDialog(SimpleMixer.this);

      if (rc == JFileChooser.APPROVE_OPTION) {
    trackFile = chooser.getSelectedFile();
View Full Code Here

Examples of javax.swing.JFileChooser.addChoosableFileFilter()

    //
    class LoadItemListener implements ActionListener {
  public void actionPerformed(ActionEvent e) {
      File trackFile = null;
      JFileChooser chooser = new JFileChooser(getChooserRoot());
      chooser.addChoosableFileFilter(new MixFileFilter());

      int rc = chooser.showDialog(SimpleMixer.this, "Load");

      if (rc == JFileChooser.APPROVE_OPTION) {
    trackFile = chooser.getSelectedFile();
View Full Code Here

Examples of javax.swing.JFileChooser.addChoosableFileFilter()

      if (contactTableModel.getRowCount() == 0) {
        Dialogs.showInfo(AddressBook.this, i18n.tr("No data to export"), i18n.tr("JHylaFAX Addressbook Error"));
      }
     
      JFileChooser fileChooser = new JFileChooser();
      fileChooser.addChoosableFileFilter(new FileExtensionFilter(i18n.tr("vCards (*.vcf)"), ".vcf"));
      if (fileChooser.showSaveDialog(AddressBook.this) == JFileChooser.APPROVE_OPTION) {
        try {
          SimpleContact[] contacts = getSelectedContacts();
          if (contacts.length == 0) {
            contacts = getAlllContacts();
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.