File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Drag & Drop (DnD) & Optimizing

 
Kayvon Farvardin
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Kayvon Farvardin
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic