Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Action listener for JTable row selection event

 
Douglas Kent
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've searched, but cannot find out how to add an event listener for the user selecting a row of the JTable. I want to update the Flight JComboBox with the Flight when the user selects a row of flight information. Has anyone done this?
 
Thayasaras
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this
Jtable m_table = new JTable();
..........
..........
m_table.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
int row = m_table.getSelectedRow();
int col = m_table.getSelectedColumn();
}
});
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic