Can a html that contains JavaScript be loaded in Swing ?

Recommended Answers

All 5 Replies

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

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

Again no. html can be viewed only using a browser

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

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 :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.