Created
June 10, 2013 21:19
-
-
Save beydogan/5752419 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DefaultTableModel tm = new DefaultTableModel(); | |
Vector<String> columns = new Vector<String>(); | |
columns.add("ID"); | |
columns.add("From"); | |
columns.add("To"); | |
columns.add("Departure Time"); | |
columns.add("Fare"); | |
tm.setColumnIdentifiers(columns); | |
if (routes == null) { | |
this.searchResultTable.setModel(tm); | |
return; | |
} | |
Vector<Object> row; | |
ListIterator<Route> lstrg = routes.listIterator(); | |
while (lstrg.hasNext()) { | |
Route route = lstrg.next(); | |
em.refresh(route); | |
row = new Vector<Object>(); | |
row.add(route.getId()); | |
row.add(route.getFromCity().getName()); | |
row.add(route.getToCity().getName()); | |
row.add(route.getDepartureTime()); | |
row.add(route.getFare()); | |
tm.addRow(row); | |
} | |
this.searchResultTable.setModel(tm); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment