Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #2618 > unrolled thread
| Started by | "Håkan Lane" <håkan.lane@THRWHITE.remove-dii-this> |
|---|---|
| First post | 2011-04-27 15:40 +0000 |
| Last post | 2011-04-27 15:40 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.java.gui
Underlining a node in JTr "Håkan Lane" <håkan.lane@THRWHITE.remove-dii-this> - 2011-04-27 15:40 +0000
Re: Underlining a node in "bcd" <bcd@THRWHITE.remove-dii-this> - 2011-04-27 15:40 +0000
| From | "Håkan Lane" <håkan.lane@THRWHITE.remove-dii-this> |
|---|---|
| Date | 2011-04-27 15:40 +0000 |
| Subject | Underlining a node in JTr |
| Message-ID | <470E3269.5E4A@operamail.com> |
To: comp.lang.java.gui How do I underline a specific node in JTree? I have searched a lot for it on the web, but I didn't find anything that has worked. I have been creating the tree by adding DefaultMutableTreenode instances. No changes to the look and feel or to the Renderers have been implemented in the code for the tree part. Thanks in advance. Hokan Lane --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24
[toc] | [next] | [standalone]
| From | "bcd" <bcd@THRWHITE.remove-dii-this> |
|---|---|
| Date | 2011-04-27 15:40 +0000 |
| Subject | Re: Underlining a node in |
| Message-ID | <felcrs$4r8$1@orkan.itea.ntnu.no> |
| In reply to | #2618 |
To: comp.lang.java.gui
In article <470E3269.5E4A@operamail.com>,
Hokan Lane <H.L@operamail.com> wrote:
>How do I underline a specific node in JTree?
This isn't supported out of the box. You will have to write a custom
Renderer (and Editor if you want it to be editable while underlined)
and you will need to have some way for the Renderer to be able to
deduce if any given node is to be underlined or not (either by using
custom user objects, or through some other mechanism).
This isn't really any different from e.g. having different text
colours in different nodes so if you find an example that does
something along those lines, it should be easy to adapt it to
underlining the text instead.
Cheers,
Bent D
--
Bent Dalager - bcd@pvv.org - http://www.pvv.org/~bcd
powered by emacs
---
* Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.gui
csiph-web