1

Can I use CSS or other web technologies in a Java desktop application by any means?

Note: I know as I used they are web based resources, but I want to know the ways it can be used in a Java desktop application.

4
  • why do you want to use?? if you want that kind of functionality..Directly use JavaFX..don;t need to use javascript Commented May 28, 2012 at 6:55
  • For Windows only there's this... genuitec.com/about/labs-webkit-for-swt/… Commented May 28, 2012 at 6:55
  • fxexperience.com try this out Commented May 28, 2012 at 6:57
  • JEditorPane supports simple CSS (& a sub-set of HTML 3.2), but not JavaScript. Commented May 28, 2012 at 6:58

2 Answers 2

2

You can use CSS in your Java desktop application, but you can't use JavaScript. Here is the links, you can learn how to use CSS in a Swing application'.

  1. http://today.java.net/pub/a/today/2003/10/14/swingcss.html

  2. http://tutiez.com/how-to-use-css-style-or-stylesheet-in-java-swing-jeditorpane.html

Personally, I recommended to use the 'Look And Feel' features in your application.

Sign up to request clarification or add additional context in comments.

1 Comment

But you CAN use JavaScript in a Java desktop application.
0

As stated in another answer, you can use CSS. You can also use JavaScript using Java's ScriptEngine class.

Here is the documentation: https://docs.oracle.com/javase/7/docs/technotes/guides/scripting/programmer_guide/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.