Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / March 2007

Tip: Looking for answers? Try searching our database.

MacOS X: annoying rectangle during drag and drop

Thread view: 
lemmi - 19 Mar 2007 15:18 GMT
Hi,

I have a problem when running my app under MacOS X. I have a panel in
which the user can resize and move graph objects. For this I am using
the D&D API. Everything works fine on Windows but on MacOS X I get a
rectangle during the d&d operation of the panel where the
DragGestureListener was created. The listener gets created like this:

        DragSource dragSource = new DragSource();
        dragSource.createDefaultDragGestureRecognizer(lc,
                DnDConstants.ACTION_MOVE, this);

where 'lc' is the JPanel.

I am assuming that MacOS X wants to do me a favour and display the
bounds of the dragged panel. But I do not want to drag the panel
itself, I just want to receive the drag events so that I can
manipulate graphics objects that are rendered inside the panel.

Does anyone know a fix for this?

Dirk
Andrew Thompson - 19 Mar 2007 16:11 GMT
..
> ...I do not want to drag the panel
> itself, I just want to receive the drag events so that I can
> manipulate graphics objects that are rendered inside the panel.
>
> Does anyone know a fix for this?

Use a MouseListener.

Andrew T.
lemmi - 20 Mar 2007 10:26 GMT
> ..
>
> Use a MouseListener.

I could do that but then I loose the ability to drop my graph objects
on other
components, windows or even apps.
lemmi - 25 Mar 2007 19:41 GMT
> > ..
>
[quoted text clipped - 3 lines]
> on other
> components, windows or even apps.

OK, I found out how to solve this. There are three different
startDrag()
methods on the DragGestureEvent object. At least one of them accepts
an
Image that will be shown during the drag & drop operation (at least
on
some operating systems, Windows doesn't support this, but it looks
great
on my Mac). If an image gets specified then the rectangle bounds of
my
panel will not be shown.

Dirk
steve - 26 Mar 2007 12:49 GMT
>>> ..
>>
[quoted text clipped - 17 lines]
>
> Dirk

it's only when you start to program a mac, that you realize how cool it
really  is.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.