Java에 브라우저를 임베드하는 방법이 있습니까?
Java에 브라우저를 임베드하는 방법이 있습니까?
JavaFX 2.0부터 이제 webview를 사용할 수 있습니다.
JWebPane이 브라우저를 자바 앱에 포함시키는 공식적인 방법이 될 것이라고 생각합니다. 오픈 소스 엔진 인 WebKit을 기반으로하며 Apples Safari 및 Googles Chrome 브라우저에서 사용됩니다 . 자세한 내용은 이 블로그 를 참조하세요.
이것을 시도해 볼 수 있습니다 : https://jdic.dev.java.net/
(출처 : java.net )
또는이 : http://lobobrowser.org/java-browser.jsp
(출처 : lobobrowser.org )
GUI에 SWT 를 사용할 수 있습니다 . 브라우저 컨트롤을 사용하면 IE, Mozilla 또는 Safari (실행중인 플랫폼에 따라 다름)를 약간의 고통없이 포함 할 수 있습니다.
JxBrowser has not been mentionned yet. It embed either Mozilla Firefox (Gecko), Apple Safari (WebKit) or Internet Explorer. Programmer's Guide
Take a look at https://xhtmlrenderer.dev.java.net/
I have successfully opened a browser from Java using SWT. You can find code examples of how to use SWT to open a Browser window. It's very easy to do.
By far the most robust embeddable browser I am familiar with is the one in SWT. In fact, it is so flexible that the JavaDoc hover you can see in Eclipse is actually a browser, and the JavaDoc view actually supports things like animation!
The only risk with using SWT is that there are different versions of the SWT library for different platforms. I'm not sure if there is a singl jar you could include to cover everyone.
You can embed a browser in a Swing/AWT GUI using the JDIC API. I don't see any mention of OS X, so it may not be of use to you.
You could also try the JWebBrowser from DJ Native Swing: http://djproject.sourceforge.net/ns
You can try Webrenderer or Ice Browser
If you need a pure Java solution then you can try JWebEngine. It render HTML 4 very good. You can use it in an applet, Java webstart and on any platform. The using is very simple.
You could try a JEditorPane
, it doesn't interpret advanced HTML, nor Javascript, nor advanced CSS, but you can write that part yourself, called the EditorKit
. That is the class/object that is consulted by the JEditorPane or how it has to display its content.
I know its possible, because I tried and failed (:P), but it could be outdated or deprecated by now, I don't know.
If you look at The Minecraft launcher (the old one), look through LoginForm or LauncherFrame, you may be able to find out that method. There is a tutorial by kippykip on youtube on how to decompile and edit it: here
Maybe Chromium Embedded Framework is an option for you. Specific to Java there is
javacef for SWT: https://github.com/wjywbs/javacef
AWT 용 java-cef : https://bitbucket.org/chromiumembedded/java-cef
참고 URL : https://stackoverflow.com/questions/48249/is-there-a-way-to-embed-a-browser-in-java
'Programing' 카테고리의 다른 글
Git Bash에서 Windows 네트워크 경로를 사용하는 방법 (0) | 2020.11.12 |
---|---|
10 Fall Creators Update [Local Repo]에서 승리 한 이후로 매우 느린 (거북이) (0) | 2020.11.12 |
데이터 목록과 함께 Python에서 Matplotlib를 사용하여 히스토그램을 그리는 방법은 무엇입니까? (0) | 2020.11.11 |
Android context.getResources.updateConfiguration () 지원 중단됨 (0) | 2020.11.11 |
일반 텍스트에서 가장 적게 사용 된 구분 문자 <ASCII 128 (0) | 2020.11.11 |