View Single Post
  #2 (permalink)  
Old 07-30-2007, 12:53 AM
hardwired hardwired is offline
Senior Member
 
Join Date: Jul 2007
Posts: 1,266
hardwired is on a distinguished road
Quote:
cannot resolve symbol
symbol : constructor KeyStroke ()
location: class javax.swing.KeyStroke
KeyStroke k = new KeyStroke();
The compiler is telling you it cannot find a no–argument Keystroke constructor.
Look in the KetStroke class api. There are no constructors. All KeyStroke instances are obtained from the static methods.
Code:
KeyStroke k = KeyStroke.getKeyStroke(5 possible args);
Quote:
cannot resolve symbol
symbol : method getKeyStroke ()
location: class javax.swing.KeyStroke
key = k.getKeyStroke();
Same thing: can't find a method getKeyStroke called on a KeyStroke instance. Check the api. A KeyStroke instance is already a KeyStroke.
Code:
KeyStroke keyStroke = KeyStroke.getKeyStroke("UP");
Reply With Quote