JavaScript UI With Java Base - java

I'm working on an application written in Java, which is my main programming language. However, the GUI's Java provides are not exactly fitting for my needs. I've been struggling to create something good but kept starting over, until an Idea visited my head.
You may have heard of Brackets, an open source project by Adobe which is a desktop application for editing HTML / CSS / JavaScript / etc. It is written in JavaScript, which makes me think that its makes a GUI using HTML and CSS. That seems like a very attractive alternative, but I do not want to have to code the entire application in Javascript.
TL;DR - I want to make a GUI in JavaScript / HTML but have the main application run on Java.
P.S. This is my first question, please be forgiving.

Related

How to use CSS graph in java

Is there a way to implement good design graphs in java?
I come from web front end, and I'd like to create graphs with amazing style effect in java - Just like how I would do in javascript and CSS?
Something like this:
You can take a look to those libs:
JfreeChart
JavaFX
I can miss some others.
I built a month ago an J2EE app (with servlet and JSP page) and I had to deal with charts and honestly I dropped the idea of doing it in Java. The reason? The difficulty of finding a good API/lib and the poor documentation of these.
I personally chose to use AngularJS and my data are produced with a Java program (NOT telling you that's the best method).
My charts are made with Zingchart. I found it very powerful due to the fact that the charts can be made from JSON (easy to make in Java).
Hope I helped you.

making a browser without using JTextPane or any other class that reads HTML

Good evening, I'm working on a project with a team, we have to make a browser without using JEditorPane or any other class that reads HTML.
How can we do that? Do we need to make a new class that does what JEditorPane does? Can I find somewhere JEditorPane's code? Thanks!
Well, this is an answer:
If you need to display web content without using any pre-existing engine (such JEditorPanel or a ChromeBind), you need to read the HTML as a XML file and construct your native View based on it (without CSS and JS this is a fairly easy task) by constructing the screen based on a one-to-one equivalent of a HTML tag to a Java JComponent.
Modern Web Browsers are pretty complicated, so there are a lot of different pieces that come together to display a web page. In order to build a browser, you need to first understand what a browser is. For that, I recommend reading this tutorial.
Once you have an understanding of how a browser actually works you need to determine which pieces you can reuse and which pieces you have to write from scratch. Do you have to write the entire rendering engine? Good luck! Can you use an existing engine like Gecko or Webkit? Or maybe you can get a little closer to done and use the java port of Webkit?
Once you have a better understanding of the question come back and ask more direct questions when you get stuck at a specific piece. As it is, your first step is to gain an understanding of the problem you are trying to solve.

Can one open another application within a javaFX frame?

I am currently working on a desktop application in which one can generate a responsive website for documentation (java-doc like) by providing nothing more than a simple word document.
I currently have a prototype working in which I select for styles on certain paragraphs to determine its function and how it should be transformed to a correct HTML representation. I also found a way to dynamically link to certain section of the document. Everything is working however I would really like to combine the list of documents to generate, a preview of the to-be generated website and a text editor program in 1.
since this will be relying on word heavily I was wondering if Java FX provides a means to display an application such as word or openoffice within an internal frame. Much like how Java Fx's webview displays websites.
In an ideal situation it would look something like this:
Any help would be greatly appreciated.
Alas, not possible in a plausible way.

Generating Java GUI code from basic HTML/Javascript

I would like to know the best way and what it would require(languages/libraries) to generate Java GUI code from an HTML page with embedded Javascript code. It would emulate the HTML objects(like divs/tables) and their interactions. I don't need to emulate any complicated Javascript libraries, but just get basic functionality like handling mouse clicks/movements and key presses which Java can easily support.
I was thinking of representing all of the HTML objects using absolute positioning in Java without having to generate code for layout managers.
EDIT:
Regarding seand's comment: I meant that I don't need to convert code written in JQuery or other Javascript libraries into Java GUI code. I only want to deal with simple Javascript.
I was searching as well and it appears that nothing seems really meant to do that.
However one option is to embed a browser into your app using something like:
http://djproject.sourceforge.net/ns/
http://www.eclipse.org/articles/Article-SWT-browser-widget/browser.html
And then used it to load your HTML pages.

Converting Swing app to web

I have Java code of the algorithm that has numeric values as its input and output. The GUI is implemented as Swing in Eclipse. Now I would like to tranfer to the web environment and create the web-tool using JavaScript or sth like this. Is there any way to use the Java code of my algorithm without rewriting it?
if your logic and goi all together at the same class you need to remove all the GUI part and stay with all the logic. after you have logic class you can use what ever goi you want(swing, html, jsf....)
Another alternative is to skip the HTML part by hand and just create your HTML app in Java. No need for separate servlets serving Java validation to your HTML inputs. The open source framework Vaadin that we've been working on since 2001 and it has an almost 100% similar API to Swing could be an alternative for this for you. And it would hopefully save you a lot of time.
As a swing developer the most relevant starting point for you would be: https://vaadin.com/swing
You can look up in to servlets and if you do it in netbeans then will be much easier for you.

Categories

Resources