L
Luke
Hi
I have a windows form with a jtable
I have a listenere that open a new form when a row of the jtable is
clicked
this is the event:
public void valueChanged(ListSelectionEvent event) {
if(event.getSource() == jTable1.getSelectionModel() &&
event.getFirstIndex() >= 0 ) {
TableModel model = (TableModel)jTable1.getModel();
String string =
(String)model.getValueAt(jTable1.getSelectedRow(), 0);
ModificaStudenteComunicazione nStud = new
ModificaStudenteComunicazione(string, id_com, false);
nStud.setVisible(true);
}
}
so a new form opens. in this form I have a Clode button that simply
close the window. the code of the close button is;:
this.dispose();
this works right only for 2 times. I mean:
I open form B from form A clicking on a row of the jtable inside form
A. When B il loaded I click close and B closes.
I do the same another time and it works ok.
I do the same for the 3rd time and B doesn't open. It seems that the
listener doesn't understand that I clicked on the jtable.
is this the right code to use to open/close windows?
thanks
I have a windows form with a jtable
I have a listenere that open a new form when a row of the jtable is
clicked
this is the event:
public void valueChanged(ListSelectionEvent event) {
if(event.getSource() == jTable1.getSelectionModel() &&
event.getFirstIndex() >= 0 ) {
TableModel model = (TableModel)jTable1.getModel();
String string =
(String)model.getValueAt(jTable1.getSelectedRow(), 0);
ModificaStudenteComunicazione nStud = new
ModificaStudenteComunicazione(string, id_com, false);
nStud.setVisible(true);
}
}
so a new form opens. in this form I have a Clode button that simply
close the window. the code of the close button is;:
this.dispose();
this works right only for 2 times. I mean:
I open form B from form A clicking on a row of the jtable inside form
A. When B il loaded I click close and B closes.
I do the same another time and it works ok.
I do the same for the 3rd time and B doesn't open. It seems that the
listener doesn't understand that I clicked on the jtable.
is this the right code to use to open/close windows?
thanks