Скачиваний:
30
Добавлен:
03.06.2014
Размер:
2.3 Кб
Скачать
/*
* FileCooser.java
*
* Created on 5 Ноябрь 2005 г., 23:30
*/

package architecture;

/**
*
* @author Сергей Барыкин
*/
public class FileChooser extends java.awt.Dialog {

private Processor pOwner;
/** Creates new form FileCooser */
public FileChooser( Processor parent, boolean modal) {
super((java.awt.Frame) parent, modal);
pOwner=parent;
initComponents();
this.setVisible(true);
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
private void initComponents() {//GEN-BEGIN:initComponents
jPanel1 = new javax.swing.JPanel();
jFileChooser1 = new javax.swing.JFileChooser();

addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
closeDialog(evt);
}
});

jFileChooser1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jFileChooser1ActionPerformed(evt);
}
});

jPanel1.add(jFileChooser1);

add(jPanel1, java.awt.BorderLayout.CENTER);

pack();
}//GEN-END:initComponents

private void jFileChooser1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jFileChooser1ActionPerformed
try {
pOwner.loadCommands(jFileChooser1.getSelectedFile());
System.out.println("2");
setVisible(false);
dispose();
}
catch (Exception e) {
System.out.println(e.getMessage());
}
}//GEN-LAST:event_jFileChooser1ActionPerformed

/** Closes the dialog */
private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
setVisible(false);
dispose();
}//GEN-LAST:event_closeDialog

// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JFileChooser jFileChooser1;
private javax.swing.JPanel jPanel1;
// End of variables declaration//GEN-END:variables

}
Соседние файлы в папке architecture