Package javax.swing

Examples of javax.swing.JFileChooser.addActionListener()


      FileSystemView file_system_view;
        file_system_view = FileSystemView.getFileSystemView();
        file_chooser = new JFileChooser( file_system_view );
        file_chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        file_chooser.setMultiSelectionEnabled(false);
        file_chooser.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent event) {
            if(event.getActionCommand() == JFileChooser.APPROVE_SELECTION) { 
                  final File file = file_chooser.getSelectedFile();
                  (new JMThread(new JMRunnable() {
                   public void JMRun() {
View Full Code Here


    @Override
    public Component getCustomEditor() {
        JFileChooser fc = new JFileChooser();
        fc.setDialogType(JFileChooser.SAVE_DIALOG);
        fc.setSelectedFile(new File((String) getValue()));
        fc.addActionListener(new AbstractAction() {

            public void actionPerformed(ActionEvent e) {
                if (e.getActionCommand().equals(JFileChooser.APPROVE_SELECTION)) {
                    try {
                        setValue(((JFileChooser) e.getSource()).getSelectedFile().getCanonicalPath());
View Full Code Here

                ".fcDesc", // NOI18N
                        "This dialog box enables selection of files")); // NOI18N
        fileChooser.setApproveButtonMnemonic('O');

        fileChooser.setMultiSelectionEnabled(true);
        fileChooser.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (e.getActionCommand().equals("ApproveSelection")) { // NOI18N
                    File[] files = fileChooser.getSelectedFiles();
                    for (int i = 0; i < files.length; i++) {
                        if (!listModel.contains(files[i])) {//don't allow duplicates
View Full Code Here

        ExtensionFileFilter codyFilter = new ExtensionFileFilter(new String("cody"), "Cody Files");
        jFileChooser.setAcceptAllFileFilterUsed(false);
        jFileChooser.addChoosableFileFilter( codyFilter);
        jFileChooser.setApproveButtonText("Abrir");
        jFileChooser.setBackground(new java.awt.Color(254, 254, 254));
        jFileChooser.addActionListener(new java.awt.event.ActionListener() {
            @Override
      public void actionPerformed(java.awt.event.ActionEvent evt) {
              String botaoPressionado = evt.getActionCommand();
               File f = jFileChooser.getSelectedFile();
               if(f != null && botaoPressionado.equals("ApproveSelection")){
View Full Code Here

        ExtensionFileFilter codyFilter = new ExtensionFileFilter(new String("cody"), "Cody Files");
        jFileChooser.setAcceptAllFileFilterUsed(false);
        jFileChooser.addChoosableFileFilter( codyFilter);
       
        jFileChooser.setFont( fonte.getFontTexto() );
        jFileChooser.addActionListener(new java.awt.event.ActionListener() {
            @Override
      public void actionPerformed(java.awt.event.ActionEvent evt) {
              String botaoPressionado = evt.getActionCommand();
            int ret;
              File f = jFileChooser.getSelectedFile();
View Full Code Here

                ".fcDesc", // NOI18N
                        "This dialog box enables selection of files")); // NOI18N
        fileChooser.setApproveButtonMnemonic('O');

        fileChooser.setMultiSelectionEnabled(true);
        fileChooser.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (e.getActionCommand().equals("ApproveSelection")) { // NOI18N
                    File[] files = fileChooser.getSelectedFiles();
                    for (int i = 0; i < files.length; i++) {
                        if (!listModel.contains(files[i])) {//don't allow duplicates
View Full Code Here

          return false;
        }
      };
    }
    fileChooser.setFileFilter(filter);
    fileChooser.addActionListener(new ActionListener() {
      public void actionPerformed(final ActionEvent pE) {
        firePropertyChangeEvent();
      }
    });
    return fileChooser;
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.