Solved

JTree events not generated

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

690 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