Solved

JTree events not generated

Posted on 2009-07-06
4
331 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jboss wildfly 10.1 10 594
maven module vs maven project 3 110
Export all vba modules from outlook vbaproject.otm 7 71
Eclipse for Java EE development 2 67
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
Suggested Courses

737 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