Package javax.swing

Examples of javax.swing.JFileChooser.showDialog()


      public void actionPerformed(final ActionEvent ae) {
        final JFileChooser chooser = new JFileChooser(System.getProperty("user.dir"));
        chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        chooser.setFileFilter(new FileNameExtensionFilter("rif document", "rif","txt"));

        if(chooser.showDialog(DocumentEditorPane.this.that, "Import") == JFileChooser.APPROVE_OPTION) {
          final String fileName = chooser.getSelectedFile().getAbsolutePath();
          DocumentEditorPane.this.visualRifEditor.importNewDocument(FileHelper.fastReadFile(fileName));
        }
      }
    });
View Full Code Here


      this.jTF_visualRepr_left.setEditable(false);

      JButton visualRepr_left_button = new JButton("Select");
      visualRepr_left_button.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          int ret = chooser.showDialog(that, "Select");

          if(ret == JFileChooser.APPROVE_OPTION) {
            String fileName = chooser.getSelectedFile().getAbsolutePath();

            that.jTF_visualRepr_left.setText(fileName);
View Full Code Here

      this.jTF_visualRepr_right.setEditable(false);

      JButton visualRepr_right_button = new JButton("Select");
      visualRepr_right_button.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          int ret = chooser.showDialog(that, "Select");

          if(ret == JFileChooser.APPROVE_OPTION) {
            String fileName = chooser.getSelectedFile().getAbsolutePath();

            that.jTF_visualRepr_right.setText(fileName);
View Full Code Here

    JButton jB_targetPath = new JButton("Select");
    jB_targetPath.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        int ret = chooser.showDialog(that, "Select");

        if(ret == JFileChooser.APPROVE_OPTION) {
          String fileName = chooser.getSelectedFile().getAbsolutePath();

          jTF_targetPath.setText(fileName);
View Full Code Here

    final JButton jB_ownImage = new JButton("Select");
    jB_ownImage.setEnabled(false);
    jB_ownImage.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        int ret = chooser.showDialog(that, "Select");

        if(ret == JFileChooser.APPROVE_OPTION) {
          String fileName = chooser.getSelectedFile().getAbsolutePath();

          jTF_ownImage.setText(fileName);
View Full Code Here

    JButton jB_targetPath = new JButton("Select");
    jB_targetPath.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        int ret = chooser.showDialog(that, "Select");

        if(ret == JFileChooser.APPROVE_OPTION) {
          String fileName = chooser.getSelectedFile().getAbsolutePath();

          jTF_targetPath.setText(fileName);
View Full Code Here

      public void actionPerformed(final ActionEvent ae) {
        final JFileChooser chooser = new JFileChooser(System.getProperty("user.dir"));
        chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        chooser.setFileFilter(new FileNameExtensionFilter("JSON Save files", "json"));

        if(chooser.showDialog(VisualRifEditor.this.that, "Open") == JFileChooser.APPROVE_OPTION) {
          final String fileName = chooser.getSelectedFile().getAbsolutePath();

          VisualRifEditor.this.that.saveLoader.load(fileName);
        }
      }
View Full Code Here

        final SaveDialog chooser = new SaveDialog(System.getProperty("user.dir"));
        chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        chooser.setFileFilter(new FileNameExtensionFilter("JSON Save files", "json"));

        if(chooser.showDialog(VisualRifEditor.this.that, "Save") == SaveDialog.APPROVE_OPTION) {
          String fileName = chooser.getSelectedFile().getAbsolutePath();

          if(!fileName.endsWith(".json")) {
            fileName += ".json";
          }
View Full Code Here

      public void actionPerformed(final ActionEvent ae) {
        final JFileChooser chooser = new JFileChooser(System.getProperty("user.dir"));
        chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        chooser.setFileFilter(new FileNameExtensionFilter("rif document", "txt","rif"));

        if(chooser.showDialog(VisualRifEditor.this.that, "Import") == JFileChooser.APPROVE_OPTION) {
          final String fileName = chooser.getSelectedFile().getAbsolutePath();

          VisualRifEditor.this.that.importNewDocument(FileHelper.fastReadFile(fileName));
        }
      }
View Full Code Here

        final SaveDialog chooser = new SaveDialog(System.getProperty("user.dir"));
        chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        chooser.setFileFilter(new FileNameExtensionFilter("rif document", "txt","rif"));

        if(chooser.showDialog(VisualRifEditor.this.that, "Export") == SaveDialog.APPROVE_OPTION) {
          String fileName = chooser.getSelectedFile().getAbsolutePath();

          if(!fileName.endsWith(".rif")) {
            fileName += ".rif";
          }
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.