Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Can anyone explain to me (point me to right documentation) on how to embed an HTML page into Java dialog box? Thank you all so much.
The tutorial on How to use HTML in Swing Components will show you how to do it exactly.
Add a comment
I guess the following code should work for you:
String htmlMsg = "<html>You can use</b>HTML here</html>"; JOptionPane dialogBox = new JOptionPane(); dialogBox.setMessage(msg); dialogBox.setMessageType(JOptionPane.INFORMATION_MESSAGE); //....
You could use the LGPL Flying Saucer libraries, it all depends on what you want to achieve with the HTML. It's got XHTML + CSS covered, but is less backwards compatible than other renderers.
Required, but never shown
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.
Explore related questions
See similar questions with these tags.