Solved

JTree events not generated

Posted on 2009-07-06
4
323 Views
Last Modified: 2013-12-14
Dear Experts,
I am using JTree to hold some selection possibilities.
I would like to respond to selections and perform some operations.
However, none of the event handlers are ever reached.

FocusGained, MouseReleased, ValueChanged, and KeyReleased


I am using Netbeans 6.5 with Java 1.6. or so

Any ideas how I can fix this problem?
0
Comment
Question by:allmer
  • 2
  • 2
4 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
ID: 24783992
Did you add the handlers to the object(s)?
0
 
LVL 5

Author Comment

by:allmer
ID: 24784134
I merely used the Netbeans facility to add the handlers.
but it seems that Netbeans does add it:

        jTree1.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {
            public void valueChanged(javax.swing.event.TreeSelectionEvent evt) {
                jTree1ValueChanged(evt);
            }
        });

On second thought you are right.
I create a new tree and I did not add the listeners again.

Right on CEHJ!
0
 
LVL 5

Author Closing Comment

by:allmer
ID: 31600102
Easy to miss such a problem .. thanks
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 24784386
:-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
The line on IDE 4 67
eclipse package explorer vs project explorer view 2 74
Java passing arguments (type error) 2 48
egit plugin on eclipse 8 31
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
This video teaches viewers about errors in exception handling.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now