Z
zelao.itu
Hi everybody, I'm doing an app where I need to get a value from a
variable of another JDialog.
My MainFrame call the class SelectClient, where SelectClient has a
JTable with all data. when user double click over the table it supose
to return the data of the selected cell.
I tried like this :
//main.java
public void actionPerformed(ActionEvent e) {
if(e.getSource() == btCad) {
SelectClient tmp = new SelectClient(this);
while(tmp.running) {
try {
wait();
} catch ( InterruptedException e1) { }
}
String data = tmp.data;
tmp.dispose();
//SelectClient.java
class SelectClient extends JDialog ....
public void mouseClicked(MouseEvent e) {
if (e.getSource() == tableClients) {
if (e.getClickCount() == 2) {
data = tableModel.getPrimaryKey(1);
running = false;
notifyAll();
}
}
}
variable of another JDialog.
My MainFrame call the class SelectClient, where SelectClient has a
JTable with all data. when user double click over the table it supose
to return the data of the selected cell.
I tried like this :
//main.java
public void actionPerformed(ActionEvent e) {
if(e.getSource() == btCad) {
SelectClient tmp = new SelectClient(this);
while(tmp.running) {
try {
wait();
} catch ( InterruptedException e1) { }
}
String data = tmp.data;
tmp.dispose();
//SelectClient.java
class SelectClient extends JDialog ....
public void mouseClicked(MouseEvent e) {
if (e.getSource() == tableClients) {
if (e.getClickCount() == 2) {
data = tableModel.getPrimaryKey(1);
running = false;
notifyAll();
}
}
}