This Is What Ticks Me Off With Sun and Swing
So I have been spending most of my evening trying to get drag and drop from a JTree to a JList to work with Java6's alleged "simpler D&D support". Simple is relative. I need to actually transfer the user object from the DefaultMutableTreeNode for my application to really work correctly so that meant providing my own TransferHandler and Transferable implementations.
Well, I sort of got it working but wanted to spruce it up with a nice icon when the node is being dragged. Looking at the API (and in my case the source code) I found a method:
public Icon getVisualRepresentation(Transferable transferable)
that I can simply override and provide my icon. So I did this but no icon was showing up. Debugging I then found this method was never even called. Google time!! Found this:
http://bugs.sun.com/view_bug.do?bug_id=4816922
Reported in 2003. Still not fixed. Ok, so drag and drop works. But it looks like garbage and I had a hard enough time getting this to work as is. I personally don't feel like I should have to go and override all the drag source and drag target nonsense just for something like this. Absolutely rediculous that Sun can't (won't) fix something like this. I'm curious if this works in JavaFX only to the extent of if it does, why can't they backport it into Swing?
So freaking ticked off right now because even though this is a trivial issue that doesn't stop my app from working Swing is full of these kinds of bugs that have been sitting for years.
Re: This Is What Ticks Me Off With Sun and Swing
Re: This Is What Ticks Me Off With Sun and Swing
Re: This Is What Ticks Me Off With Sun and Swing
Re: This Is What Ticks Me Off With Sun and Swing
Seems like complaining about Sun/Swing/JavaFX has become popular.
Here's some recommended reading for people who wants to complain about Sun or Swing.
I am developing on web (JSF, PHP/Symfony, a little Wicket), and also a little Swing, so I feel qualified to comment on this issue.