Drag and Drop file from desktop to JTable. Works but get a NullPointerException at TableDropTargetListener.restoreComponentState()

Posted on 2006-04-30
Last Modified: 2008-01-09
What I am doing is enabling dragging and dropping of a file from ann outside source to a JTable. I created the a custom TransferHandler to deal with the new imported file in a way that I need it to. Everything works fine but it also throws a NullPointerException in the background as the title describes originating from the java.awt.EventDispatchThread. This only happens when I set the transferHandler (using my custom TrasferHandler) on the JTable. If I set it on the JScrollPane that contains the JTable, never the NullPointerException. Obviously it's something to do with the JTable. Any ideas on how to fix this?


Question by:cmp2
    1 Comment
    LVL 23

    Accepted Solution

    If you are using Net beans then i thnk it a bug as per

    else you need to put forward that piece of code where you are getting the exception.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
    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 …
    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:
    This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

    758 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

    9 Experts available now in Live!

    Get 1:1 Help Now