Ihave a problem which I cannot figure out. I have a math drill program which I've made and I made one JPanel class (named MainPanel extends JPanel) which contains 30 JPanels (named ProblemPanel extends JPanel), each containing one math drill problem. Each of the drill JP's has a JTextField which is used for entering the answer. The whole shebang is contained in a JFrame class (named MadMinute extends JFrame) for display.
When the kids press enter, the entry in the JTextField is evaluated for correctness and the focus is supposed to jump to the JPanel with the next problem. I've used an anonymous inner class with addActionListener() method of the JTextField and included the transferFocus() in the inner class. How does transferFocus work? I can tab between the ProblemPanels, but I can't make the Enter key work. I'm using Java 1.3.1.
Roy from Iowa
When the kids press enter, the entry in the JTextField is evaluated for correctness and the focus is supposed to jump to the JPanel with the next problem. I've used an anonymous inner class with addActionListener() method of the JTextField and included the transferFocus() in the inner class. How does transferFocus work? I can tab between the ProblemPanels, but I can't make the Enter key work. I'm using Java 1.3.1.
Roy from Iowa