PDF Viewer: Access Scroll Bars

I’m having trouble getting access to the scroll bars on the pdf viewer component, java noob here. I was able to control the rotation and zoom mode with the swingController ,target.getController(), but I don’t see anything with the scroll bars. Will those be apart of JScrollPane or something else?

Update I was able to get to the value of the scroll bar with

target = event.source.parent.getComponent('PDF Viewer')
swingController = target.getController()
viewController = swingController.getDocumentViewController()
hScroll = viewController.getHorizontalScrollBar()
print hScroll.getValue()

Wow, impressed myself a little bit :slight_smile: I figured it out.

target = event.source.parent.getComponent('PDF Viewer')
swingController = target.getController()
viewController = swingController.getDocumentViewController()
hScroll = viewController.getHorizontalScrollBar()
rightJustify = hScroll.getMaximum()
hScroll.setValue(rightJustify)
swingController.updateDocumentView()
2 Likes