I want to expand my Jtree nodes into multiple lines. Any idea for how to achieve this?
warlord902
9
Junior Poster
Recommended Answers
Jump to Postyes
from http://download.oracle.com/javase/tutorial/uiswing/index.html is basic stuff about JTree http://download.oracle.com/javase/tutorial/uiswing/components/tree.html and search/look for TreeModel
tons …
Jump to PostI vote your answer as best reply in April 2011, but here isn't "lonely hearts" post your code, then we'll see
Jump to PostI've never tried this, but the nodes in JTree are rendered by default using JLabels.
You can put multi-line text in a JLabel by using simple HTML, so maybe you can use HTML to get multi-line nodes? Try a node with text like this:
<HTML>line 1a<BR>line1b<?HTML>
you never know...…
All 16 Replies
mKorbel
274
Veteran Poster
warlord902
9
Junior Poster
mKorbel
274
Veteran Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
warlord902
9
Junior Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
mKorbel
274
Veteran Poster
warlord902
9
Junior Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
mKorbel
274
Veteran Poster
warlord902
9
Junior Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
warlord902
9
Junior Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
mKorbel
274
Veteran Poster
warlord902
9
Junior Poster
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.