Details
Description
I use the folowing code to display the PDF viewer into a panel :
<CODE>
public class PDFViewerPanel extends JPanel {
SwingController viewerController = new SwingController();
public PDFViewerPanel() {
DocumentViewController viewController = viewerController.getDocumentViewController();
viewerController.setIsEmbeddedComponent(true);
JComponent viewerComponentPanel = (JComponent) viewController.getViewContainer();
// add copy keyboard command
ComponentKeyBinding.install(viewerController, viewerComponentPanel);
// add interactive mouse link annotation support via callback
viewController.setAnnotationCallback(
new org.icepdf.ri.common.MyAnnotationCallback(viewController));
removeAll();
add(viewerComponentPanel);
}
public boolean openFile(String filePath) {
viewerController.openDocument(filePath);
revalidate();
return true;
}
}
</CODE>
I get a NPE at SwingController line 2356 because the utilityTabbedPane is null.
THANKS FOR YOUR WORK.
<CODE>
public class PDFViewerPanel extends JPanel {
SwingController viewerController = new SwingController();
public PDFViewerPanel() {
DocumentViewController viewController = viewerController.getDocumentViewController();
viewerController.setIsEmbeddedComponent(true);
JComponent viewerComponentPanel = (JComponent) viewController.getViewContainer();
// add copy keyboard command
ComponentKeyBinding.install(viewerController, viewerComponentPanel);
// add interactive mouse link annotation support via callback
viewController.setAnnotationCallback(
new org.icepdf.ri.common.MyAnnotationCallback(viewController));
removeAll();
add(viewerComponentPanel);
}
public boolean openFile(String filePath) {
viewerController.openDocument(filePath);
revalidate();
return true;
}
}
</CODE>
I get a NPE at SwingController line 2356 because the utilityTabbedPane is null.
THANKS FOR YOUR WORK.
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
Marking as fixed.