How to use CSS graph in java - 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.

Related

Clojure: CSS / DOM like UI for Java

Notes:
The answer is NOT clojurescript. I want to code in Clojure, not ClojureScript.
Context:
I like the CSS/DOM model for user interfaces more than I like Java's Graphics2D.
Question:
Is there some way / some project that embeds a WebKit of sorts into a Java Application? I would like to be able to code in Java, but also be able to have a GUI which I can control/manipulate via CSS/DOM.
Thanks!
The JavaFX 2.0 scene graph is somewhat similar in concept to a DOM, and you can skin it using CSS.
There is a Java API, so you should be able to use this fairly easily from Clojure.
It's not exactly CSS/DOM, but seesaw allows to query Swing widget hierarchies with CSS-like selectors.
You can find a list of more-or-less mature GUI libraries here.
An above-mentioned Seesaw can fit. GUIFTW uses a CSS-like stylesheets for describing the UI and may also meet your needs but it wasn't updated for a year now.

Web UI for existing Java application

I am trying to build a search engine using java and the lucene API as part of a project. For the last step, we plan to build a web UI (a local host would do) for the same. Are there UI softwares/plugins for eclipse which will allow me to call the functions present in the java classes?
Essentially I would want to have a search box and a search key, pressing which will throw up the search results(which is computed from the java program). javascript cannot call java code I understand. So using that is eliminated?
Any suggestions on what to use will be greatly appreciated. I have pretty poor knowledge in front end design!
Cheers!
AB
If all you have is a simple screen with a entry field and a button and you simply want to return an html table. I would go with a servlet and two jsps. Your servlet can call your search engine and then have the jsp format the data into the table. If you do not know web apis this is probably the easiest entry.
I think, If your using JAVA, that you should look into JSF.
It's a rather easy to maintain and work with library for just the uses you describe.
I recommend these tutorials to get you started: http://www.coreservlets.com/JSF-Tutorial/jsf2/#Tutorial-Intro
There are lots of options to achieve this.
you can create web-ui using jsp.
I have also created same type of project using Lucene, here i have used spring mvc.i have provided all the back-end process as REST api which any web-ui can use.
Please do not look into JSF; it is an overengineered pile for your task.
Sure you can call your java code from javascript, you can make it really simple with something like DWR.
However, for your project I would suggest GWT as then you only deal with Java and it will generate javascript, html and css for you.
For your project you dont really need an "enterprise" level framework like spring or a fullstack JavaEE, you could keep it real oldschool with only JSPs and html/javascript. However thats a bit too flaky for my taste, so go with GWT.
With GWT you basically set it up, define your module, entrance point (look at the hello world), and then you add a layout to your page like something to place the searchbox into and the resultbox to. Then you call your other Java code and classes from there like you normally would.
I would suggest you to use GWT in your application because GWT enables you to call java methods and it will also convert Javascript and css for your Java modules after GWT compile.
GWT reference :- http://code.google.com/webtoolkit/gettingstarted.html
If you're going to use GWT, you could aslo check Vaadin.
Creating a search UI is really simple, and the tutorial show a criteria /result table application taht could be adapted.

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.

Desktop-like UI implementations for Java web applications?

At work we're discussing upgrading our view layer for our web application. We're currently running an old and "modified" version of FreeMarker Classic, which is a pain to work with. One of our developers suggested using a Component UI style architecture similar to desktop style environments.
Essentially, this would mean that you would build custom HTML components as Java Classes that the controller would render into the Document view. This would completely take away the need to write HTML into a view layer. The Components would generate the view layer for you.
For instance, the following rendered HTML:
<h1>I am a title</h1>
<p>I am a paragraph.</p>
Would be generated by doing something like:
String titleString = "I am a title";
html.elements.Heading heading = new html.elements.Heading(Heading.H1, titleString);
String paraString = "I am a paragraph.";
html.elements.Paragraph paragraph = new html.elements.Paragraph(paraString);
PrintWriter somePrintWriter = new PrintWriter();
Document document = new Document();
document.addElement(heading);
document.addElement(paragraph);
document.compose(somePrintWriter);
The above code is just an example, don't critique the names or style, I just wrote it for a quick demonstration of what we may be trying to accomplish. I'm trying to determine if this has been done before in Java, and if so if there are any links I can be pointed to. I've been researching it as much as I can, but haven't found any implementations that completely remove the template layer (such as JSP or JSF).
Thanks!
There is a pure Java way where EVERYTHING is built using Java. Check it out here
http://www.zkoss.org/
UPDATE: I found even better one. Also pure Java. http://vaadin.com/home
How about GWT?
Echo2/Echo3 might be useful.
Echo is a platform for building
web-based applications that approach
the capabilities of rich clients. The
applications are developed using a
component-oriented and event-driven
API, eliminating the need to deal with
the "page-based" nature of browsers.
To the developer, Echo works just like
a user interface toolkit.
I used GWT-Ext to create a desktop-feel for a Java-based web app. It was very well received and feels very much like you are not within a web browser at all.
Click is pretty close, to what you are describing. It does use Velocity, but if you take a look at the Advanced Forms example, the template was very basic.
wingS is another one that looks to be close to what you want. It is supposed to be Swing like.

Java Graphing Libraries for Web Applicattions?

I've been asked to enhance a JSP Application with (And I quote) "Some Sexy Graphs" I did a quick search on SO and came up with this question which mentions several graphing solutions, however given that this is a Web application I was wondering if there were any good graphing libraries that can render the graphs client side using JQuery or some such?
Otherwise, has anyone who has used JFreeChart to produce charts for the Web got any pointers.
This is the first time I've done Any JSP (I've done some Java and Have done a bit of ASP.Net) so Any pointers would be appreciated.
Are you looking for a graph or a chart library? JFreeChart is great for charts. Touchgraph is great for graphs.
Touchgraph:
www.touchgraph.com
Look at this example:
http://www.touchgraph.com/TGGoogleBrowser.html
You could also use google's charting engine:
http://code.google.com/apis/chart/

Categories

Resources