This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi, I'm new to the Ranch. I would normally ask my friend who is pretty good with Java but he hasn't been online lately and I want the program done by next weekend. (heres his website for the curious ones www.yellowbirdcomputing.com )
Anyway, here are my questions:
1. I have a little 1st program which I want to add DnD to. I want to add DnD to my JList but haven't been able to find instructions on the Java website. ATM all I have so far is model.setDragEnabled(true) which in OS X brings up the green + showing that it is trying to drag somthing which must mean i got it right, cept it won't drop since i haven't defined the dropping part (i wish gravity applied to programs )
2. About optimizing, In my program i have this as my import statements:
And I noticed for a small program it loads a little slow. The 1st working version i had (which was a 4kb .jar) it takes 2 seconds to load on my Win2k, AMD 64 2ghz, 600ish Mb, ATI x300 PC. On my G3, 256Mb iBook it takes longer but thats understandable due to specs. I was wondering if maybe my imports were the problem since they seem to make the computer import the entire library? Would specifying what things to load (like javax.swing.JButton ) make it start faster?
Sorry If I wrote alot, I tried to be as discriptive as possible with my questions. [ October 21, 2006: Message edited by: Kavon Farvardin ]
Originally posted by Kavon Farvardin: ...I was wondering if maybe my imports were the problem since they seem to make the computer import the entire library? Would specifying what things to load (like javax.swing.JButton ) make it start faster? ...
No, import statements only open the door for visibility, so the class can be found when needed. They do not "bloat" programs. (See this Sun Tech Tip.)
As for the DnD part of your question, I'm going to move this thread to the Swing forum, so it gets expert attention. Please continue this discussion there.
Welcome to JavaRanch! [ October 21, 2006: Message edited by: marc weber ]
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org
Joined: Oct 21, 2006
Thank you for the move and answer to one of them Marc.
Just to clarify, I need DnD support only for within a JList, not complicated outside DnD if thats what any one is thinking. Basicly just the ability to rearrange the list with dragging. Thanks in advance [ October 21, 2006: Message edited by: Kavon Farvardin ]