?
-
i current have a subclass of JDialog that has only these two lines in
the constructor:
getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
DISPOSE_ACTION_KEY);
getRootPane().getActionMap().put(DISPOSE_ACTION_KEY,
new AbstractAction() {
public void actionPerformed(ActionEvent evt) {
dispose();
}
});
is it right to subclass it? or should i switch to composition?
the constructor:
getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
DISPOSE_ACTION_KEY);
getRootPane().getActionMap().put(DISPOSE_ACTION_KEY,
new AbstractAction() {
public void actionPerformed(ActionEvent evt) {
dispose();
}
});
is it right to subclass it? or should i switch to composition?