Available Methods
- APPROVE_OPTION
- getSelectedFile ( )
- showOpenDialog ( )
- setFileSelectionMode ( )
- setDialogTitle ( )
- setCurrentDirectory ( )
- setFileFilter ( )
- setSelectedFile ( )
- showSaveDialog ( )
- setMultiSelectionEnabled ( )
- addChoosableFileFilter ( )
- setAcceptAllFileFilterUsed ( )
- showDialog ( )
- setApproveButtonText ( )
- setDialogType ( )
- getSelectedFiles ( )
- CANCEL_OPTION
- setFileHidingEnabled ( )
- getCurrentDirectory ( )
- addPropertyChangeListener ( )
- setAccessory ( )
- setApproveButtonMnemonic ( )
- FILES_ONLY
- OPEN_DIALOG
- setApproveButtonToolTipText ( )
- ERROR_OPTION
- setFileView ( )
- addActionListener ( )
- setPreferredSize ( )
- getFileFilter ( )
- DIRECTORIES_ONLY
- getChoosableFileFilters ( )
- removeChoosableFileFilter ( )
- isMultiSelectionEnabled ( )
- setVisible ( )
- setSelectedFiles ( )
- getDialogType ( )
- FILES_AND_DIRECTORIES
- setDragEnabled ( )
- updateUI ( )
- putClientProperty ( )
- isDirectorySelectionEnabled ( )
- setLocation ( )
Related Classes
- java.io.File
- java.io.FileInputStream
- java.io.FileOutputStream
- java.io.FileNotFoundException
- java.net.MalformedURLException
- java.io.FileWriter
- java.util.logging.Logger
- java.util.logging.Level
- java.awt.image.BufferedImage
- javax.imageio.ImageIO
- java.awt.Color
- java.awt.event.ActionEvent
- java.awt.event.ActionListener
- javax.swing.JPanel
- java.awt.Dimension
- javax.swing.JFrame
- java.awt.Font
- javax.swing.JLabel
- javax.swing.JButton
- java.awt.event.KeyEvent
- java.awt.BorderLayout
- javax.swing.JOptionPane
- java.awt.Component
- javax.swing.JScrollPane
- java.awt.Toolkit
Java Code Examples for javax.swing.JFileChooser#setLocation()
The following examples show how to use
javax.swing.JFileChooser#setLocation() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ClientGUI.java From megamek with GNU General Public License v2.0 | 6 votes |
private boolean saveGame() { ignoreHotKeys = true; JFileChooser fc = new JFileChooser("./savegames"); fc.setLocation(frame.getLocation().x + 150, frame.getLocation().y + 100); fc.setDialogTitle(Messages.getString("ClientGUI.FileSaveDialog.title")); int returnVal = fc.showSaveDialog(frame); ignoreHotKeys = false; if ((returnVal != JFileChooser.APPROVE_OPTION) || (fc.getSelectedFile() == null)) { // I want a file, y'know! return false; } if (fc.getSelectedFile() != null) { String file = fc.getSelectedFile().getName(); // stupid hack to allow for savegames in folders with spaces in // the name String path = fc.getSelectedFile().getParentFile().getPath(); path = path.replace(" ", "|"); client.sendChat("/localsave " + file + " " + path); //$NON-NLS-1$ return true; } return false; }
Example 2
Source File: Preferences.java From pdfxtk with Apache License 2.0 | 5 votes |
void apply(JFileChooser jfc) { jfc.setLocation(location); if(selection.length == 1) { if(selection[0] != null) jfc.setSelectedFile(selection[0]); } else jfc.setSelectedFiles(selection); }