net.sf.jomic.ui
Class FileFieldAdder
java.lang.Object
net.sf.jomic.ui.FileFieldAdder
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.util.EventListener
public class FileFieldAdder
- extends java.lang.Object
- implements java.awt.event.ActionListener
Utility class to add components to an existing JPanel to set a file path. The user can choose to
either type it in a text field or select it in a JFileChooser.
- Author:
- Thomas Aglassinger
Constructor Summary |
FileFieldAdder(javax.swing.JPanel newContainer,
java.awt.GridBagConstraints constraints,
javax.swing.JFileChooser newChooser)
Create a new FileFieldAdder which immediately adds the relevent components to the specified
JPanel. |
Method Summary |
void |
actionPerformed(java.awt.event.ActionEvent event)
Process event after the "..." button was pressed and open a JFileChooser to select a file. |
void |
dispose()
|
javax.swing.JFileChooser |
getChooser()
|
javax.swing.JTextField |
getField()
|
javax.swing.JLabel |
getLabel()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileFieldAdder
public FileFieldAdder(javax.swing.JPanel newContainer,
java.awt.GridBagConstraints constraints,
javax.swing.JFileChooser newChooser)
- Create a new FileFieldAdder which immediately adds the relevent components to the specified
JPanel.
- Parameters:
newContainer
- the JPanel to which the file field component should be added; it must
be using a GridBadLayoutconstraints
- the GridBagConstraints of newContainer
applied to
components to be addednewChooser
- the JFileChooser to use when the "..." button was pressed; if this is
null
, a generic default chooser is used
getChooser
public javax.swing.JFileChooser getChooser()
getField
public javax.swing.JTextField getField()
getLabel
public javax.swing.JLabel getLabel()
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent event)
- Process event after the "..." button was pressed and open a JFileChooser to select a file.
- Specified by:
actionPerformed
in interface java.awt.event.ActionListener
dispose
public void dispose()