File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Navigation Event in JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Navigation Event in JTable" Watch "Navigation Event in JTable" New topic

Navigation Event in JTable

Dvir G.

Joined: May 31, 2004
Posts: 5
Well, I didn't get a solution to create a JTable as a row in other JTable, So I changed to UI design for two seperate JTables with Master-Details relations between them.
However, I am still having troubles to create the relations between the Tables, by capturing navigation events in the master table and populate the details table with relevant data.
Does anyone have an example for it?

I didn't find events like CurrentRowChanged or anything near, do you have any idea where should be an event like this?

praveen kumar gudapati

Joined: Sep 26, 2003
Posts: 15
new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
DefaultListSelectionModel defaultListSelectionModel =
(DefaultListSelectionModel) e.getSource();

if (!defaultListSelectionModel.isSelectionEmpty()) {
// get Corresponding Children here and show them in
//detail table
} else {
// clear the children in detail table

The main idea is to add a ListSelectionListener to the master table and keep listening for changes.
Hope this helps you.
Dvir G.

Joined: May 31, 2004
Posts: 5
It did help.
Thank you very much.
I agree. Here's the link:
subject: Navigation Event in JTable
It's not a secret anymore!