List of usage examples for javax.swing.text DefaultEditorKit beepAction
String beepAction
To view the source code for javax.swing.text DefaultEditorKit beepAction.
Click Source Link
From source file:MainClass.java
MainClass(String title) {
super(title);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel jp = new JPanel();
JLabel jl = new JLabel("Name:");
jp.add(jl);//from ww w . ja va 2s .co m
JTextField jt = new JTextField(20);
jp.add(jt);
KeyStroke ks = KeyStroke.getKeyStroke(KeyEvent.VK_B, Event.CTRL_MASK);
jt.getInputMap().put(ks, DefaultEditorKit.beepAction);
getContentPane().add(jp);
pack();
setVisible(true);
}