0

How do I create a GUI with a scrolling text area and underneath small paragraphs of text there are corresponding images?

I am currently using a JTextArea with a scroll-bar to display the text and it works great, but I want to display the corresponding images underneath each small paragraph of text.

2 Answers 2

2

You can use javax.swing.JTextPane

Check TextSamplerDemo

You can find plenty of examples here:

http://www.java2s.com/Code/Java/Swing-JFC/TextPaneSample.htm

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

Comments

1

The easiest way to do this, would be to use JEditorPane with HTMLEditorKitYou can use HTML text formnatting including graphics, just like a webpage.

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.