Changing the setMnemonic behavior of JButton so that it responds to CTRL instead of ALT

Try this workaround!

import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
public class Main extends JFrame {
   JList list; 
   public Main() {
      getContentPane().setLayout(new FlowLayout());
      final JButton button = new JButton("Click-Me!");
      ActionListener al = new ActionListener() {
         public void actionPerformed(ActionEvent ae) {
            System.out.println("Button was clicked!");
      // don't use button.setMnemonic('C') if you want only the CTRL mask to work,
      // use button.getModel() instead. 
      KeyStroke keyStroke = KeyStroke.getKeyStroke('C', Event.CTRL_MASK, false); 
      button.registerKeyboardAction(al, keyStroke, JComponent.WHEN_FOCUSED); 
      addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent event) {
      setSize(400, 400);
   public static void main(String[] args) {
      (new Main()).show();