Solved

JTree events not generated

Posted on 2009-07-06
4
322 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
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.

747 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

12 Experts available now in Live!

Get 1:1 Help Now