public void jOpenButton_actionPerformed(ActionEvent actionEvent) {
    FileFilter filter = new FileFilter( "Archivos Agente (*.agt)" );
    filter.add("agt");
    JFileChooser file = new JFileChooser( fileDir );
    file.setFileFilter(filter);
    if( file.showOpenDialog(this) == JFileChooser.APPROVE_OPTION ){
      try {
        fileDir = file.getSelectedFile().getAbsolutePath();
        fileName = file.getSelectedFile().getName();
        BufferedReader reader = new BufferedReader( new FileReader(fileDir) );
        StringBuffer sb = new StringBuffer();
        String s = reader.readLine();
        while( s != null ){
          sb.append(s);
          sb.append('\n');
          s = reader.readLine();
        }
        jTextArea1.setText(sb.toString());
        reader.close();
        this.setTitle(title + " [" + fileName + "]");
      }
      catch (Exception e) {
        e.printStackTrace();
      }
    }

  }