• Post Reply Bookmark Topic Watch Topic
  • New Topic

double click on one of the row in JTable..  RSS feed

 
fiddy chan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need to double click on the row and another JFrame will appear.. and how can i pass the parameter down to the another JFrame??
my code:
if(mouseEvent.getClickCount() == 2) {
updateRecord(); //
}
public void updateRecord() {

UpdateExpense exFrame = new UpdateExpense();
exFrame.setSize(420,470);
exFrame.setTitle("Update Expense");
exFrame.setVisible(true);
this.setVisible(false);

if(booleanAllExpense==true){
int i = expenseList.getSelectedIndex();
exp = (Expense) expenseA.get(i);
expTextField.setText(expense.getExpense());
amtTextField.setText(Double.toString(expense.getAmount()));
}
}
pls give me some advice.. thanks alot..
 
Eddie Vanda
Ranch Hand
Posts: 283
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would modify the UpdateExpense constructor to take any parameters you want to pass.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!