Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6842057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:03:05+00:00 2026-05-27T00:03:05+00:00

I am using a slightly modified version of the Sun’s example JTreeTable backed by

  • 0

I am using a slightly modified version of the Sun’s example JTreeTable backed by my own model. That would be the third example (bookmarks one at http://java.sun.com/products/jfc/tsc/articles/bookmarks/).

Everything works as expected except drag and drop support. I wanted DnD which is more like what a JTree provides. Since JTreeTable is an extended JTable it provides the JTable.DropLocation class for determining drop locations which does not offer enough information when dropping stuff into the tree rendered column of the JTreeTable (no path and no child index). I’ve already solved that by creating a custom DropLocation class which is based on a combination of JTable and JTree versions of it. I’ve also modified the paint method of the TreeTableCellRenderer class which is provided by the mentioned JTreeTable implementation to show this new information to the user (she is now able to see if the new node will be placed inside, before or after the selected node if inside the tree column, as you would expect from a JTree).

There is one problem though. The mouse cursor is going crazy when the drop location is being rendered inside the tree column. It appears and then disappears a few milliseconds later or this happens so fast that the drag cursor is not even shown. This happens with the unmodified Sun’s example too. I am completely in the dark as to why this is happening. Did find another person with the same problem at http://www.java.net/node/663106, but the solution provided there seems to set the component’s drop location to null and cannot be retrieved using JTreeTable.getDropLocation() method any more. I need this to convert it to my modified DropLocation and then paint stuff based on it.
I am so close to a proper solution for my use case that I can taste it. This cursor blinking thing is the only obstacle in my way. Any ideas?

Using Java 1.6.

P.S.: I’ve decided for a custom JTreeTable and not for one of the existing components (like Netbeans Outline or JXTreeTable) because they all appear to be suffering from the JTable.DropLocation problem and do not offer support for dropping before or after the selected tree node (only inside). If you know of a component which does provide such functionality I’d be glad to hear about it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T00:03:06+00:00Added an answer on May 27, 2026 at 12:03 am

    that sounds like a manifestion of core bug #6700748 (can’t verify, that darn bug parade takes ages to connect to ..). So citing from the fix in JXTreeTable:

        /**
         * {@inheritDoc} <p>
         * 
         * Overridden to hack around #766-swingx: cursor flickering in DnD
         * when dragging over tree column. This is a core bug (#6700748) related
         * to painting the rendering component on a CellRendererPane. A trick
         * around is to let this return false. <p>
         * 
         * This implementation applies the trick, that is returns false always. 
         * The hack can be disabled by setting the treeTable's client property
         * DROP_HACK_FLAG_KEY to Boolean.FALSE. 
         * 
         */
        @Override
        public boolean isVisible() {
            return shouldApplyDropHack() ? false : super.isVisible();
        }
    
    
        /**
         * Returns a boolean indicating whether the drop hack should be applied.
         * 
         * @return a boolean indicating whether the drop hack should be applied.
         */
        protected boolean shouldApplyDropHack() {
            return !Boolean.FALSE.equals(treeTable.getClientProperty(DROP_HACK_FLAG_KEY));
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using a slightly modified Soh Tanaka's Smart Columns , but in his example
I'm using a slightly modified version of Valum's upload [ github link ], I've
I am using a slightly modified version of the DotZlib which is part of
I am using a slightly modified version of this code . to create a
I'm using a slightly modified version of Twain Dot Net in my scanning application.
I'm using jQuery (1.6.4) and using a slightly modified version of this method to
I'm trying to debug a slightly-modified version of the ADO.NET POCO Entity Generator template
I'm using slightly modified sample code provided by the YUI team. When my source
I have a slightly modified AccountController that should write a row into a table
Referring to a slightly modified version of a jqGrid local editing demo by user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.