private JPanel createToolbar
() { panel.
setBackground(Color.
GREEN);
@Override
System.
out.
println("Pressed " + e.
getKeyChar()); }
@Override
System.
out.
println("Pressed " + e.
getKeyChar()); }
@Override
// startCapture();
System.
out.
println("Pressed " + e.
getKeyChar()); }
});
panel.setFocusable(true);
panel.requestFocusInWindow();
//KeyListener listener = new MyKeyListener();
//panel.addKeyListener(listener);
//panel.setFocusable(true);
// panel.KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(this)
//KeyboardExampl keyboardExample = new KeyboardExample();
//panel.add(keyboardExample);
// capturing = false;
// btnStartStop = new Button("Compartir Recorte");
// btnStartStop.addActionListener(new ActionListener() {
// @Override
// public void actionPerformed(ActionEvent e) {
// if (capturing) {
// capturing = false;
// btnStartStop.setLabel("Start Capture");
// stopCapture();
// } else {
// capturing = true;
// btnStartStop.setLabel("Stop Capture");
// System.out.println("Capturando ");
// startCapture();
// }
// }
// });
// Detener_frame = new Button("Detener Recorte");
// Detener_frame.addActionListener(new ActionListener() {
// @Override
// public void actionPerformed(ActionEvent e) {
// startCapture();
// stopCapture();
// }
// });
//btnStartStop.setFocusable(true);
// panel.add(btnStartStop);
// panel.add(Detener_frame);
panel.setFocusable(true);
// panel.setVisible(false);
return panel;
}