Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-07-2007, 06:22 PM
Ada Ada is offline
Member
 
Join Date: May 2007
Posts: 8
Ada is on a distinguished road
Is it possible to disable drop in a component?
I have a drag enabled component in my app. Is it possible to disable the drop part? I mean, I'd like to be able to drag elements from this component but I don't want to be able to drop items on it.

Thanks in advance.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-07-2007, 06:23 PM
Senior Member
 
Join Date: Dec 2006
Posts: 748
levent is on a distinguished road
As described in the Drag and Drop tutorial, you should replace the default transfer handler of the component.

See: Introduction to Drag and Drop and Data Transfer (The Java™ Tutorials > Creating a GUI with JFC/Swing > Drag and Drop and Data Transfer) for an example.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 06-07-2007, 06:24 PM
Ada Ada is offline
Member
 
Join Date: May 2007
Posts: 8
Ada is on a distinguished road
Yes, I know it. I replaced the default transferhandler with my own. I have two JLists, I need to disable the drop component in the first JList and the the drag component in the second one, so I can only drag items from the first list to the second one, and not the other way around. Is it possible?
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 06-07-2007, 06:52 PM
Senior Member
 
Join Date: Dec 2006
Posts: 748
levent is on a distinguished road
Of course it is... if you had read the tutorial you wouldn't ask for it, but here are useful links:

http://java.sun.com/j2se/1.4.2/docs/...abled(boolean)
http://java.sun.com/j2se/1.4.2/docs/...ansferHandler)

I hope it will make sense now,
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable Radio button AJG New To Java 0 04-07-2008 09:37 PM
How to use a drop-down box in Struts piterskiy74 Web Frameworks 1 02-13-2008 12:42 PM
Drag and drop abhivenugopal JavaServer Pages (JSP) and JSTL 0 01-30-2008 03:10 PM
disable parent window ismailsaleh AWT / Swing 1 01-08-2008 12:15 AM
Disable BACK and CANCEL buttons in wizard consutes SWT / JFace 2 11-12-2007 10:37 PM


All times are GMT +3. The time now is 08:48 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org