Shell shell = new Shell();
shell.setSize(1000, 800);
Composite c = new Composite(shell, SWT.NULL);
c.setLayout(new FillLayout(org.eclipse.swt.SWT.VERTICAL));
c.setSize(800, 700);
OleFrame oleFrame = new OleFrame(c, SWT.NONE);
File file=new File("a.pdf");
OleClientSite clientSite = new OleClientSite(oleFrame, SWT.BORDER, file);
clientSite.doVerb(OLE.OLEIVERB_SHOW);
System.out.println(clientSite.getProgramID());
shell.setSize(1000, 800);
Composite c = new Composite(shell, SWT.NULL);
c.setLayout(new FillLayout(org.eclipse.swt.SWT.VERTICAL));
c.setSize(800, 700);
OleFrame oleFrame = new OleFrame(c, SWT.NONE);
File file=new File("a.pdf");
OleClientSite clientSite = new OleClientSite(oleFrame, SWT.BORDER, file);
clientSite.doVerb(OLE.OLEIVERB_SHOW);
System.out.println(clientSite.getProgramID());
本文介绍如何利用Shell和OleFrame组件在Eclipse框架中打开并展示PDF文件,具体步骤包括创建Shell、设置尺寸、创建Composite、布局管理、创建OleFrame以及调用OLE显示操作。
1855

被折叠的 条评论
为什么被折叠?



