如何嵌入在摆动的JFrame SWT浏览器 [英] how to embed SWT browser in swing jframe
问题描述
我要嵌入摆动的JFrame我SWT的浏览器。
我尝试样品,但它需要调整窗口大小来加载浏览器窗口。
我能做些什么来重画在画布上,用了调整?
下面是GIT展示了如何在一个传统的Swing的JPanel嵌入SWT的工作示例:
https://gist.github.com/caprica/6890618 (文字版:<一href=\"https://gist.githubusercontent.com/caprica/6890618/raw/d89b6d9442b29cd454dcdd275437127f6ff5a1f1/SwtBrowserCanvas.java\"相对=nofollow>这里)
关键是要创建一个 java.awt.Canvas的
链接到一个SWT外壳。此帆布可以添加到任何tradionnal Swing组件。 SWT的外壳环是由一个单独的线程管理 P>
下面是在我的Windows 7与Java 7箱截图:
I want to embed my SWT browser in swing jframe. I try sample, but it need to resize the window to load browser window. what can I do to repaint the canvas, with out resizing?
Here is a working example on GIT showing how to embed SWT in a traditional Swing JPanel: https://gist.github.com/caprica/6890618 (Text version: here)
The trick is to create a java.awt.Canvas
linked to an SWT shell. This canvas can be added to any tradionnal Swing component. The SWT shell loop is managed by a separate thread.
Here is a screenshot on my Windows 7 box with Java 7:
这篇关于如何嵌入在摆动的JFrame SWT浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!