version 1.23 | version 1.24 |
---|
| |
// Copyright (c) 2001-2002 Board of Trustees of the University of Illinois | // Copyright (c) 2001-2002 Board of Trustees of the University of Illinois |
// Theoretical Biophysics Group http://www.ks.uiuc.edu/ | // Theoretical Biophysics Group http://www.ks.uiuc.edu/ |
// | // |
// $Id: FileChooserBean.java,v 1.23 2002/08/30 20:48:22 mbach Exp $ | // $Id: FileChooserBean.java,v 1.24 2002/10/18 16:03:10 mbach Exp $ |
// | // |
| |
import java.awt.*; | import java.awt.*; |
| |
/** the name of the file */ | /** the name of the file */ |
private String m_strFileName = ""; | private String m_strFileName = ""; |
| |
private JLabel m_lFile = new JLabel("URL, PDB, VRML, or ID Code:"); | //private JLabel m_lFile = new JLabel("URL, PDB, VRML, or ID Code:"); |
| private JLabel m_lFile = new JLabel("URL, PDB, or ID Code:"); |
private JButton m_buttonBrowse = new JButton("Browse..."); | private JButton m_buttonBrowse = new JButton("Browse..."); |
private JButton m_buttonSelectFile = new JButton("Load File"); | private JButton m_buttonSelectFile = new JButton("Load File"); |
private JTextField m_tfFileInput = new JTextField(20); | private JTextField m_tfFileInput = new JTextField(20); |
| |
| |
/** ActionListener class to handle "Select" button action */ | /** ActionListener class to handle "Select" button action */ |
public class SelectFileListener implements ActionListener { | public class SelectFileListener implements ActionListener { |
| /** Sets the file name and closes the dialog window |
| * @param e ActionEvent signalling the "Select" button has been pressed |
| */ |
public void actionPerformed(ActionEvent e) { | public void actionPerformed(ActionEvent e) { |
selectFile_actionPerformed(e); | selectFile_actionPerformed(e); |
} | } |
| |
| |
/** ActionListener class to handle "Browse" button action */ | /** ActionListener class to handle "Browse" button action */ |
public class BrowseListener implements ActionListener { | public class BrowseListener implements ActionListener { |
| /** Opens the Browser dialog |
| * @param e ActionEvent signalling the "Browse" button has been pressed |
| */ |
public void actionPerformed(ActionEvent e) { | public void actionPerformed(ActionEvent e) { |
browse(e); | browse(e); |
} | } |
| |
| |
/** ActionListener class to handle bringing up the popup window */ | /** ActionListener class to handle bringing up the popup window */ |
public class MainListener implements ActionListener { | public class MainListener implements ActionListener { |
| /** Brings up the file chooser dialog |
| * @param e ActionEvent to open the file dialog |
| */ |
public void actionPerformed(ActionEvent e) { | public void actionPerformed(ActionEvent e) { |
fPopup.show(); | fPopup.show(); |
} | } |