Simple Keyboard input?
I am a new programmer trying to create a simple keyboard input for a Jframe, if that is possible. Here is a simple jframe creation:
publicstaticvoid main(String[] args){
JFrame frame =new JFrame("Keyboard input");
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
// make window visible
frame.pack();
frame.setVisible(true);
}
If I wanted to make a class that would put a ball in the frame and have the ball move up, down, left, or right according to which arrow keys were pressed and held- how would I do that?
Thanks for your help,
Sam

