File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Event Listeners Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Event Listeners" Watch "Event Listeners" New topic

Event Listeners

Melinda Wilson
Ranch Hand

Joined: Jul 05, 2001
Posts: 35
I would like to know is it possible to write an event to use the page up and page down key on the key board to scroll up and down on a web page. What I have read is that the Event Listeners are used in applets to call a key when a keyboard is pressed. I don't write applets, just front end JSPs with backend servlets. Is it even possible to do this though I have never been able to use pageup pagedown keys on web pages. Just wondering if anyone has even thought or tried.
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
You can use the Robot class to post key events to the event queue. You should be able to scroll by posting VK_PAGE_UP or VK_PAGE_DOWN.
There was an example of it posted in this thread

"JavaRanch, where the deer and the Certified play" - David O'Meara
I agree. Here's the link:
subject: Event Listeners
It's not a secret anymore!