String preferencesKey = "TestHumanPane";
showNewHumanFrame(nc, title, preferencesKey, actionListener);
}
public static void showNewHumanFrame(NamedCaller nc, String title, String preferencesKey, final ActionListener actionListener) {
final CFrame f=new CFrame(nc, title,preferencesKey){
private static final long serialVersionUID = -6994485943614587439L;
public Dimension getPreferredSize() {
return ScreenBoundsUtil.getScreenBounds().getSize();
}
protected int getDefaultExtendedState() {
return Frame.MAXIMIZED_BOTH;
}
};
HumanPane c=new HumanPane(nc, net.sf.abproject.addressbook.ab.datamodel.HumanImpl.createNewUnlinkedHuman(), actionListener, f);
WindowAdapter windowListener = new WindowAdapter() {
public void windowClosing(WindowEvent e) {
if(actionListener.cancelPressed())f.dispose();
}
};
f.getContentPane().setLayout(new BorderLayout());
f.getContentPane().add(c);
f.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
f.addWindowListener(windowListener);
f.setVisible(true);
}