Keyboard Input with swing Java
问题 I am working a calculator using java swing and I want to be able to enter the numbers and operations via keyboard. I can't seem to get it working. import java.awt.*; import javax.swing.*; import java.awt.event.*; public class Calculator extends JFrame implements ActionListener { JPanel[] row = new JPanel[6]; JButton[] button = new JButton[23]; JMenuBar menubar = new JMenuBar(); JMenu file = new JMenu("File"); JMenuItem clear = new JMenuItem("Clear"); JMenuItem exit = new JMenuItem("Exit");