private void createGroupTabs() {
groupTabs = new JTabbedPane();
// create models
GroupListModel allgroupmodel = new GroupListModel();
GroupListModel newgroupmodel = new GroupListModel();
GroupListModel subscribedgroupmodel = new GroupListModel();
// popuplate models
try {
Iterator<Group> it = HibernateUtils.listGroups().iterator();
Group g;
while(it.hasNext()) {
g = it.next();
allgroupmodel.addElement(g);
if(g.isSubscribed()) {
subscribedgroupmodel.addElement(g);
}
}
} catch (JDBCConnectionException e) {
System.err.println("Cannot open connection to database.");
System.err.println("Maybe you restarted to fast? Let HSQLDB recover from last session.");