🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.java.swing
5 messages
5 total messages Started by Rudy Wed, 17 Dec 2003 18:49
Jtree
#1378
Author: Rudy
Date: Wed, 17 Dec 2003 18:49
20 lines
1455 bytes
I have a JTree set out for example below

A
    Image A
    B
    C
        Image C
D
    Image D
    E
        Image E
    F

what i want to do is, if the user has C selected on the clicfk of a button
then it prints Image C, but if A or be are pressed then it prints Image A,
likewise if D of F are selected then Image D is printed, and if E is
selected then Image E is printed.

Any tips would be greatly appreciated
Rudy
Re: Jtree
#1389
Author: Rudy
Date: Thu, 18 Dec 2003 19:32
25 lines
1653 bytes
To clarify it is not an image but the filename for the image, thanks
"Rudy" <rhentzen@hotmail.com> wrote in message
news:3fe0a530@newsgroups.borland.com...
> I have a JTree set out for example below
>
> A
>     Image A
>     B
>     C
>         Image C
> D
>     Image D
>     E
>         Image E
>     F
>
> what i want to do is, if the user has C selected on the clicfk of a button
> then it prints Image C, but if A or be are pressed then it prints Image A,
> likewise if D of F are selected then Image D is printed, and if E is
> selected then Image E is printed.
>
> Any tips would be greatly appreciated
> Rudy
>
>
Re: Jtree
#1392
Author: John McGrath [TeamB]
Date: Thu, 18 Dec 2003 22:12
14 lines
1256 bytes
On 12/17/2003 at 1:49:21 PM, Rudy wrote:

> Any tips would be greatly appreciated

What have you tried?

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Re: Jtree
#1397
Author: Rudy
Date: Fri, 19 Dec 2003 07:08
21 lines
1707 bytes
Well, i have looked at each of the jTrees get methods, but they do not seem
to do the trick, i need to look at the TreePath class and the node class i
think,

Rudy
"John McGrath [TeamB]" <ng-b@JPMcGrath.net> wrote in message
news:3fe2345e$1@newsgroups.borland.com...
> On 12/17/2003 at 1:49:21 PM, Rudy wrote:
>
> > Any tips would be greatly appreciated
>
> What have you tried?
>
> -- 
> Regards,
>
> John McGrath [TeamB]
>
> ---------------------------------------------------
> Before sending me e-mail, please read:
>     http://www.JPMcGrath.net/newsgroups/e-mail.html
Re: Jtree
#1408
Author: John McGrath [TeamB]
Date: Sat, 20 Dec 2003 00:46
20 lines
1563 bytes
On 12/19/2003 at 2:08:00 AM, Rudy wrote:

> i need to look at the TreePath class and the node class i think

Yes, you would need use the TreeNode interface to get the object held
in the tree node.  A TreePath would be one way to get at the nodes, but
it is not the only way.

The Java Tutorial has a pretty good section on using JTrees:

   http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads