JFileChooser: setControlButtonsAreShown(boolean b) : JFileChooser « javax.swing « Java by API






JFileChooser: setControlButtonsAreShown(boolean b)

  

import java.awt.BorderLayout;
import java.awt.Font;

import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;

public class Main {

  public static void main(String args[]) {
    JFrame frame = new JFrame("JFileChooser Popup");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    final JLabel directoryLabel = new JLabel(" ");
    directoryLabel.setFont(new Font("Serif", Font.BOLD | Font.ITALIC, 36));
    frame.add(directoryLabel, BorderLayout.NORTH);

    final JLabel filenameLabel = new JLabel(" ");
    filenameLabel.setFont(new Font("Serif", Font.BOLD | Font.ITALIC, 36));
    frame.add(filenameLabel, BorderLayout.SOUTH);

    JFileChooser fileChooser = new JFileChooser(".");
    fileChooser.setControlButtonsAreShown(false);
    frame.add(fileChooser, BorderLayout.CENTER);

    frame.pack();
    frame.setVisible(true);
  }
}

   
    
  








Related examples in the same category

1.JFileChooser.APPROVE_OPTION
2.JFileChooser.CANCEL_OPTION
3.JFileChooser.DIRECTORIES_ONLY
4.JFileChooser.DIRECTORY_CHANGED_PROPERTY
5.JFileChooser.ERROR_OPTION
6.JFileChooser.SELECTED_FILE_CHANGED_PROPERTY
7.JFileChooser.SELECTED_FILES_CHANGED_PROPERTY
8.JFileChooser: addActionListener(ActionListener l)
9.JFileChooser: addChoosableFileFilter(FileFilter filter)
10.JFileChooser: addPropertyChangeListener(PropertyChangeListener listener)
11.JFileChooser: createDialog(Component parent)
12.JFileChooser: getCurrentDirectory()
13.JFileChooser: getFileSystemView()
14.JFileChooser: getSelectedFile()
15.JFileChooser: getTypeDescription(File f)
16.JFileChooser: isFileHidingEnabled()
17.JFileChooser: setAccessory(JComponent newAccessory)
18.JFileChooser: setApproveButtonMnemonic(char mnemonic)
19.JFileChooser: setApproveButtonText(String approveButtonText)
20.JFileChooser: setApproveButtonToolTipText(String toolTipText)
21.JFileChooser: setCurrentDirectory(File dir)
22.JFileChooser: setFileFilter(FileFilter filter)
23.JFileChooser: setFileHidingEnabled(boolean b)
24.JFileChooser: setFileSelectionMode(int mode)
25.JFileChooser: setFileView(FileView fileView)
26.JFileChooser: setMultiSelectionEnabled(boolean b)
27.JFileChooser: setSelectedFile(File file)
28.JFileChooser: showOpenDialog(Component parent)