Browser for Java Swing Jinternalframe - java

I need to integrate a browser in a JInternalFrame. I tried a lot of different ideas:
jcef: It is based on heavyweight components an so don't work with swing
jxBrowser: is only compatible to java 8
swt Browser: works in a JFrame but not JInternalFrame, Problem is described in this question
Does someone has another Idea how to integrate a browser to swing? It should be able to show Pages, which shows webGL and compatible with java 9 and 10.
I already saw some similar questions on SO, but those are 10 years and older and don't fit for my purpose

I found a solution and it worked with The DJ Project. It contains a library, that uses the swt browser and has a API for Java Swing applications.

Related

How to draw Line Charts in Java Swing [duplicate]

This question already has answers here:
Drawing a simple line graph in Java
(6 answers)
Closed 7 years ago.
I want to draw a Line Chart out of a double Array, what's the best way to do it in swing? Is there something like in JavaFX?:
series.getData().add(new XYChart.Data(1, 23));
Or should is the best way to implement a Java FX Line Chart in Swing? It's not a duplicate, because I want to know what the better is to go.
Use a JFX Panel on a normal JPanel, in the Oracle Documenation you can finde more Information about it.
JFXPanel is the component that will help Java Fx content to embed in Java swing application
See This. You can read the tutorial here
Which one is better?
If you will use JavaFx just delete Swing in your project. JavaFx is new and have a lot of components fast and useful. Swing is always behind it.
Including two jars?
It is like going somehere with two car. When you add JavaFx to your Swing project you have to find compatible jars Swing and JavaFx. And it is expensive for your project. You got two library and these are doing same thing.
What you can do, what will you see?
I think you are using Swing with JDK 1.6. or 1.7 And you can use JavaFx 2.2 but DON'T FORGET if you use that JavaFx you have to install JavaFx Runtime to your computer. And not only you! You have to install Runtime to other users which are using your jnlp.
And if your structure based on JDK 1.8 there is no problem. Java 8 have JavaFx SDK.
And when you add JavaFx to Swing some components will not work or will work slowly.
What i suggest?
Use one library! Choose one and just it. Change your Swing Project to JavaFx project because it future of Java Desktop Application.
And if you don't want to change your project don't use JavaFx then. Use swing components.

how to use ArcGis in javafx

i am using ArcGIS Library for a geospatial project. the sample codes available in their website was fully in java Swing. i need to do path animation in it using javaFX. is it possible.? if yes, can any one suggest me a sample code to create a map.?
Sample code for creating a map in Swing
I don't think you can pull this off using JavaFX, since JMap extends JComponent and is a class provided by the ArcGIS. Unless, they release a version which is supporting JavaFX, things are not very good.
The least you can do is to embed this JMap into a JavaFX application using SwingNode. An example on how to achieve this can be found here.
I am not sure what you want to achieve, when you say "path animation in it", but if it has something that can be achieved without using the internal components of JMap, you can do it !
JMap is a Swing component. JavaFX 1 was built on Swing and supported wrapping a Swing component. JavaFX 2 does not use Swing and does not support wrapping a Swing component. It is anticipated that the upcoming JavaFX 8 will support using Swing components in a JavaFX application.
UPDATE: ArcGIS Runtime is getting support for JavaFX! See http://blogs.esri.com/esri/arcgis/2014/09/17/arcgis-runtime-plays-at-10-2-4/ for details.
You have some options:
Go back to JavaFX 1 (not a good idea IMO)
Turn it around and use JavaFX components in a Swing application (see http://docs.oracle.com/javafx/2/swing/swing-fx-interoperability.htm)
Wait for Java 8, or go get the developer preview of Java 8.
Wait for ArcGIS Runtime 10.2.4 (to be released any day now), which will have beta support for JavaFX.
Sources:
How to wrap a swing component in a javaFX 2.0 application
Class SwingNode (JavaFX 8)
Maybe a bit late but... ArcGIS Runtime for Java's latest beta (Quartz) offers much more JavaFX support.
https://developers.arcgis.com/java/beta/guide/release-notes-java.htm

Is it possible to embed a Swing component in a JavaFX application?

I've heard rumors of people creating their own custom libraries for one, but I have yet to find one for myself. I need it because I need to mount another running applet (in a JPanel in Swing) for my application.
No, at least not in an officially supported way.
There is the SwingView in the ThingsFX 3rd party library to do this.
I've never tried it, so I can't recommend for or against it.
ThingsFX has a website.
Here is a screenshot of Swing components rendered on a JavaFX Stage using ThingsFX.

JavaFx 2.0 GUI within the Netbeans Platform Application

Is there any way to integrate JavaFx 2.0 GUI within the Netbeans Platform Application? I've tried searching the topic but did not come across what I was looking for.
I am not very familiar with Netbeans RCP but it is swing based so you can embed your Java FX 2 components the same way you would embed them in a Swing application: use JFXPanels for the FX2/Swing bridge and then embed those panels in RCP the same way you would add a Swing component.
I have also seen
this tutorial but have not tried it
and this related question on SO.

Is there a way to embed a browser in Java? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
Is there a way to embed a browser in Java? more specifically, is there a library that can emulate a browser?
Since JavaFX 2.0 you can use now webview
I believe JWebPane is going to be the official way to embed a browser into a java app. Its based on the open sourced engine - WebKit, which is used in Apples Safari and Googles Chrome browsers.See this blog for details.
You may try this: https://jdic.dev.java.net/
(source: java.net)
Or this: http://lobobrowser.org/java-browser.jsp
(source: lobobrowser.org)
You could use SWT for your GUI. Its Browser control allows you to embed IE, Mozilla or Safari (depending on the platform you're running in) with little pain.
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.
Take a look at
https://xhtmlrenderer.dev.java.net/
JxBrowser has not been mentionned yet. It embed either Mozilla Firefox (Gecko), Apple Safari (WebKit) or Internet Explorer. Programmer's Guide
You could also try the JWebBrowser from DJ Native Swing: http://djproject.sourceforge.net/ns
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.
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 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.
Maybe Chromium Embedded Framework is an option for you. Specific to Java there is
javacef for SWT: https://github.com/wjywbs/javacef
java-cef for AWT: https://bitbucket.org/chromiumembedded/java-cef
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

Categories

Resources