+ public static void configureTableColumn(JTable tbl_summary,
+ Collection<PDBDocField> wantedFields)
+ {
+ try
+ {
+ // wait for table model initialisation to complete
+ Thread.sleep(1200);
+ } catch (InterruptedException e1)
+ {
+ e1.printStackTrace();
+ }
+ for (PDBDocField wantedField : wantedFields)
+ {
+ try
+ {
+ if (wantedField.equals(PDBDocField.PDB_ID))
+ {
+ tbl_summary.getColumn(wantedField.getName()).setMinWidth(40);
+ tbl_summary.getColumn(wantedField.getName()).setMaxWidth(60);
+ tbl_summary.getColumn(wantedField.getName()).setPreferredWidth(45);
+ }
+ else if (wantedField.equals(PDBDocField.TITLE))
+ {
+ tbl_summary.getColumn(wantedField.getName()).setMinWidth(300);
+ tbl_summary.getColumn(wantedField.getName()).setMaxWidth(1000);
+ tbl_summary.getColumn(wantedField.getName()).setPreferredWidth(400);
+ }
+ else if (wantedField.getGroup() == Group.QUALITY_MEASURES)
+ {
+ tbl_summary.getColumn(wantedField.getName()).setMinWidth(50);
+ tbl_summary.getColumn(wantedField.getName()).setMaxWidth(150);
+ tbl_summary.getColumn(wantedField.getName()).setPreferredWidth(85);
+ }
+ else
+ {
+ tbl_summary.getColumn(wantedField.getName()).setMinWidth(50);
+ tbl_summary.getColumn(wantedField.getName()).setMaxWidth(400);
+ tbl_summary.getColumn(wantedField.getName()).setPreferredWidth(95);
+ }
+ } catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }