954,536 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Javascript Swing

Can a html that contains JavaScript be loaded in Swing ?

dianac10
Newbie Poster
16 posts since Aug 2008
Reputation Points: 10
Solved Threads: 0
 

If what you said made sense, the answer is NO.
Html is a tagged based "language" used to create web pages. Javascript (has nothing to do with java) is executed in your browser (to be exact is executed at the client but I don't know how else to explain it so you can understand it). Javascript does not need to be compiled.
Swing is java comipled and executed as an appilcation

javaAddict
Nearly a Senior Poster
Team Colleague
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448
 

I want to load in a Swing cmponent a html page that contains Javascript. Can I do this?:)

dianac10
Newbie Poster
16 posts since Aug 2008
Reputation Points: 10
Solved Threads: 0
 

Again no. html can be viewed only using a browser

javaAddict
Nearly a Senior Poster
Team Colleague
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448
 

he means setting the page of a JEditorPane to a page contain javascript (i think). in that case it won't work

sciwizeh
Posting Pro in Training
457 posts since Jun 2008
Reputation Points: 77
Solved Threads: 23
 

It can be done :)
Try looking at webrenderer or native swing or jrex (it says it only works on linux). I tested the first two and they work :)

dianac10
Newbie Poster
16 posts since Aug 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You