import java.awt.*; import java.awt.event.*; import javax.swing.JFrame; //import javax.swing.JOptionPane; class SaveListener implements ActionListener { private JFrame gui; // constructor public SaveListener(JFrame guiref) { gui = guiref; } // method required by action listener interface public void actionPerformed(ActionEvent e) { System.out.println("AQUI SE HACE TODA LA OPERACION DE GUARDADO DE UN PACIENTE"); JPanel contentPane = (JPanel)(gui.getContentPane()); // El índice 0 indica el componente splitV JSplitPane principalPane = (JSplitPane)contentPane.getComponent(0); // pane1 - personalPane // pane2a - objectivePane // pane2b - subjectivePane personalPane pane1 = (personalPane)(principalPane.getTopComponent()); JSplitPane pane2 = (JSplitPane)(principalPane.getBottomComponent()); objectivePane pane2a = (objectivePane)(pane2.getLeftComponent()); subjectivePane pane2b = (subjectivePane)(pane2.getRightComponent()); System.out.println("Nombre: " + pane1.fieldNombre.getText()); System.out.println("Fecha: " + pane1.fechax); System.out.println("RUT: " + pane1.fieldRut.getText() + "-" + pane1.fieldVerificador.getText() ); System.out.println("Nacimiento: " + pane1.fieldNacimientoD.getText() + "/" + pane1.fieldNacimientoM.getText() + "/" + pane1.fieldNacimientoA.getText() ); JTabbedPane tabbedPane = (JTabbedPane)pane2a.getComponent(0); } }