How do I display Swing component on JSP? [duplicate] - java

This question already has answers here:
Is it possible to display Swing components in a JSP?
(3 answers)
Closed 5 years ago.
I want to do this because I want to print a Swing component on client side printJob.print(); always print on server side. Is there any other way to do so?

Since browser manufacturers removed support for applets and Java Web Start, and they were deprecated by Oracle, there is really no way to display Java GUI components on the client side from within a web-app.
An alternative might be to generate an image of the component on the server side and send that image to the client. On the other hand, there is little that can be rendered in a Swing component that can't be rendered in pure HTML, so I doubt that Swing components are even necessary.

Related

What is the difference between unsing JAVA FX and SWING [duplicate]

This question already has answers here:
Swing vs JavaFx for desktop applications [closed]
(6 answers)
Closed 7 years ago.
I am using Java Swing to develop my application and i should finish it as soon as possible, but the design is very bad.
I found some advice which tells me that I should use JAVA FX.
What is the difference between Java FX and Java Swing ?
Will there be any change on the line of code?
Main difference could be the release date... JavaFX is more recent and can be considered as the successor of Swing.
There is many very useful features added in JavaFX.
See here some key features : https://docs.oracle.com/javase/8/javafx/get-started-tutorial/jfx-overview.htm#A1131418
I can list the main features for me:
Styles can be set by CSS (something similar to)
Bindings: easy way to bind a ui-value, like width of text of input, to a field in class. Changing the value of the field updates the ui without boilerplate
Animations/Transitions: easy way to make an animation, like a ui components which blinks or moves
3D: easy way to manipulate model to make animated 3D view
For making a new application from scratch, i think you should consider using JavaFX, Swing is outdated (imho)

How light-weight is a Swing Component? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Swing components are light-weight?
There are different answers for this, but the thing is, that every place has explained it just saying AWT using a native window for every component and Swing has not been used in those examples, how does it work in Swing?
I'm not sure I completely understand your question but here goes:
Most Swing components are entirely lightweight - they are implemented with pure Java code. As far as the OS is concerned, the Swing lightweight components don't exist.
However you should know that Swing always uses at least one native component (usually the top-level window). The rest of Swing (all the lightweight components) are implemented so that they perform painting within this native component.

Is it possible create a Java desktop GUI with HTML? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to use HTML and CSS as a Java application GUI?
I'm trying to found another way to create GUIs for Java programs without Swing. I want something more dynamic and easy to use than Swing.
There is anything that I can use for this?
In truth, I want something similar to HTML. Exists?
JavaFX 2.0 might be what you are looking for (ignore JavaFX 1.0 which is very outdated):
It has an HTML-style layout language called FXML.
It also allows skinning of user interfaces with CSS-style themes.
It also has a WebView component that allows you to embed any web / HTML content in your app.
Having said that, I don't think Swing is hard to use when you get used to it, particularly if you use an improved layout manager like MigLayout.

JSF of java support for HTML5 [duplicate]

This question already has answers here:
Is it possible to use JSF+Facelets with HTML 4/5?
(5 answers)
Closed 9 years ago.
Is it possible to use JSF(Java EE) to create html5 pages instead of xhtml ?
If so are there many support issues due to html5 ?
As far as i know there isn't build-in support for html5.
All components are rendered as XHTML.
But you can alter these components to produce html5 and create new that support it.
See ICEfaces.
There are number of controls out there that support already html5.
An insteresting article series can be found here JSF 2 fu: HTML5 composite components

making web browser [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Using java to create a web browser
Is there any way to make a webbrower using java?.
if yes pls give the idea about it.
Of course you can make a webbrowser by using java.
You would have to parse the html content of the pages you request.
If you're not interested in creating your own browser, here is a link how to display simple html files.

Categories

Resources