Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capture keyboard actions from an applet 1

Status
Not open for further replies.

visualJay

Programmer
Jun 14, 2001
57
US
I am very new to Java, The school I went to for programming taught everything microsoft(ha ha)big joke isnt it. I learned some of visual J++ and Visual Basic I am trying very hard to convert to full SUN JAVA2 SDK I have just finally learned how to compile and run JAVA programs. This may sound like I am a complete idiot but with microsoft all I had to learn was to press the compile buttons for any language with in Visual Studio. I have had the basics of programming drilled it to MY HEAD millions of times I would like to move on to advanced things. What are the best books for java and how about training centers that can actually teach me and put me into the advanced bracket for programming JAVA not just the basics. Any Suggestions?

OH YA! I have also built another machine with LINUX (have not yet decided wich is better Mandrake or RED HAT) which this is also very new. Even moving around in LINUX seems harder BUT I LOVE IT! I HAVE YET TO CRASH IT UNLIKE WINDOWS!
Any Suggestions Here would be nice to?
 
OH now the main reason for this post.

Can you capture the keyboard events and I mean All events from an applet on a web page. Would like to be able to create a small drawing program with the use of keys like A is left Q is left + up 2 degrees, L is right and ? is right + 2 degrees down. But I also want to be able to capture the (Enter) key, the (SPACE bar), all number keys and all key combinations and only allow the use of certain keys and key combinations while on this page. Like setting up a small game use the Esc key to exit the page Of Course all key commands and options will be displayed for the user.
I can draw the line make the angle changes things like this with the mouse would like to set the keys to do the same. All of the keys would return to normal use when the page(applet) goes out of focus(minimized or closed) with the mouse. Does any one have suggestions?

Thank You
 
As for books try "Java How to Program" by Deitel & Deitel.

As for trapping key strokes you need to use the KeyEventListener or KeyAdapter. Any book on Java should tell you about these.
bruce21.jpg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top