Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.


Adding a KeyListener- encountered problems

  • Hi there! Me again.  I have been using the API and source and have managed to get a pretty decent Swing example of your browser happening.  I have noticed that when the browser is running and viewing a PDF file, it would appear that there are intrinsic key actions to the panel.  After doing some searching I found these in the multipage class.  My problem is, I am able to initially get the number of pages in a PDF document.  I can get it to advance and go backward between pages, but if I press the "page down" or left/right arrows, the PDF page changes without my interface updating.  I added a keylistener object to the browser, but this doesn't do much- would appear that the browser does not have the focus when you are viewing a PDF, hence no KeyListener action.  Was just wanting to know if there was a way of listening to the Browser.eventq() methods that get fired off internally when you press the arrows or page up/down so I can set up a listener interface for page changes in Swing.  Then I can post some code!

    PS- thanks for your help with all of this, I appreciate it.

    • Tom Phelps
      Tom Phelps

      You can write a simple behavior to do this.  You can also see what Fab Four does.