use of javax.swing.JRootPane in project Course_Generator by patrovite.
the class FrmColorChooser method createRootPane.
/**
* Manage low level key strokes
* ESCAPE : Close the window
* @return
*/
protected JRootPane createRootPane() {
JRootPane rootPane = new JRootPane();
KeyStroke strokeEscape = KeyStroke.getKeyStroke("ESCAPE");
KeyStroke strokeEnter = KeyStroke.getKeyStroke("ENTER");
Action actionListener = new AbstractAction() {
public void actionPerformed(ActionEvent actionEvent) {
setVisible(false);
}
};
Action actionListenerEnter = new AbstractAction() {
public void actionPerformed(ActionEvent actionEvent) {
RequestToClose();
}
};
InputMap inputMap = rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
inputMap.put(strokeEscape, "ESCAPE");
rootPane.getActionMap().put("ESCAPE", actionListener);
inputMap.put(strokeEnter, "ENTER");
rootPane.getActionMap().put("ENTER", actionListenerEnter);
return rootPane;
}
use of javax.swing.JRootPane in project Course_Generator by patrovite.
the class FrmImportChoice method createRootPane.
/**
* Manage low level key strokes ESCAPE : Close the window
*
* @return
*/
protected JRootPane createRootPane() {
JRootPane rootPane = new JRootPane();
KeyStroke strokeEscape = KeyStroke.getKeyStroke("ESCAPE");
KeyStroke strokeEnter = KeyStroke.getKeyStroke("ENTER");
Action actionListener = new AbstractAction() {
public void actionPerformed(ActionEvent actionEvent) {
setVisible(false);
}
};
Action actionListenerEnter = new AbstractAction() {
public void actionPerformed(ActionEvent actionEvent) {
RequestToClose();
}
};
InputMap inputMap = rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
inputMap.put(strokeEscape, "ESCAPE");
rootPane.getActionMap().put("ESCAPE", actionListener);
inputMap.put(strokeEnter, "ENTER");
rootPane.getActionMap().put("ENTER", actionListenerEnter);
return rootPane;
}
use of javax.swing.JRootPane in project Course_Generator by patrovite.
the class FrmSelectMap method createRootPane.
/**
* Manage low level key strokes ESCAPE : Close the window
*
* @return
*/
protected JRootPane createRootPane() {
JRootPane rootPane = new JRootPane();
KeyStroke strokeEscape = KeyStroke.getKeyStroke("ESCAPE");
KeyStroke strokeEnter = KeyStroke.getKeyStroke("ENTER");
Action actionListener = new AbstractAction() {
public void actionPerformed(ActionEvent actionEvent) {
setVisible(false);
}
};
Action actionListenerEnter = new AbstractAction() {
public void actionPerformed(ActionEvent actionEvent) {
RequestToClose();
}
};
InputMap inputMap = rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
inputMap.put(strokeEscape, "ESCAPE");
rootPane.getActionMap().put("ESCAPE", actionListener);
inputMap.put(strokeEnter, "ENTER");
rootPane.getActionMap().put("ENTER", actionListenerEnter);
return rootPane;
}
use of javax.swing.JRootPane in project Course_Generator by patrovite.
the class frmEditPoint method createRootPane.
/**
* Manage low level key strokes ESCAPE : Close the window
*
* @return
*/
protected JRootPane createRootPane() {
JRootPane rootPane = new JRootPane();
KeyStroke strokeEscape = KeyStroke.getKeyStroke("ESCAPE");
KeyStroke strokeEnter = KeyStroke.getKeyStroke("ENTER");
Action actionListener = new AbstractAction() {
public void actionPerformed(ActionEvent actionEvent) {
setVisible(false);
}
};
Action actionListenerEnter = new AbstractAction() {
public void actionPerformed(ActionEvent actionEvent) {
RequestToClose();
}
};
InputMap inputMap = rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
inputMap.put(strokeEscape, "ESCAPE");
rootPane.getActionMap().put("ESCAPE", actionListener);
inputMap.put(strokeEnter, "ENTER");
rootPane.getActionMap().put("ENTER", actionListenerEnter);
return rootPane;
}
use of javax.swing.JRootPane in project Course_Generator by patrovite.
the class FrmConfigMrb method createRootPane.
/**
* Manage low level key strokes ESCAPE : Close the window
*
* @return
*/
protected JRootPane createRootPane() {
JRootPane rootPane = new JRootPane();
KeyStroke strokeEscape = KeyStroke.getKeyStroke("ESCAPE");
KeyStroke strokeEnter = KeyStroke.getKeyStroke("ENTER");
Action actionListener = new AbstractAction() {
public void actionPerformed(ActionEvent actionEvent) {
setVisible(false);
}
};
Action actionListenerEnter = new AbstractAction() {
public void actionPerformed(ActionEvent actionEvent) {
RequestToClose();
}
};
InputMap inputMap = rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
inputMap.put(strokeEscape, "ESCAPE");
rootPane.getActionMap().put("ESCAPE", actionListener);
inputMap.put(strokeEnter, "ENTER");
rootPane.getActionMap().put("ENTER", actionListenerEnter);
return rootPane;
}
Aggregations