How to mouse-drag a JWindow?

Anybody could help me?:(
And btw, whats the difference between the mouseDragged() method and the mouseMoved()?
How do i use them?
I have read the sun tutorial, but well, still a bit dull in the practice someho :p
Been trying to override them for a while to make it work, but it haven't went well so far

Oh n btw, i did use JWindow intentionally, in case ur wondering why i didn't use JFrame instead

I did not use mouse events on a JWindow, so i dont know possible problems there but as far as i guess those events should work same in ancestors of JComponent. But you can check what is reffered with a JWindow, if a JWindow does not contain inner part of a window, then catching events in that tiny area will be difficult!

About the difference of mouseDragged and mouseMoved: mouseDragged event is fired when you move your mouse while the left mouse button is clicked! In mouseMoved, left mouse button does not need to be clicked. So even moving mouse around on top of your component will fire mouseMoved!

If you write your code and ask your specific problems, i might help better.

Well, im just trying to make some images appear in a JWindow, just for practice
If i add some right-clicks inside the window then it will give an option whether to close the window (terminating the application that is) or not, so far that was solved by using a JOptionPane

I also want if i do left-click inside the window, there would be a choice just like the usual left click menu, containing properties and some other custom choices which i might insert later
Though, i havent find any way to process whether the MouseEvent input is a left or right click, anybody know how?:confused:

Bout the mouseDrag problem, i want to make it that if i mousePressed and drag the window, the window would follow according to where i dragged it, just like if u drag a frame, but in JWindow i cant seem to drag it at all
Actually, none of the MouseMotionListener implementation worked at all, the mouseMoved itself that Mr. levent said to send a MouseEvent simply by hovering above the component doesn't work even when i move my mouse inside the window

Bit troubled here, anybody experienced with JWindow could help me?:(
here's the code so far, just a simple one

I also want if i do left-click inside the window, there would be a choice just like the usual left click menu, containing properties and some other custom choices
You can use a JPopupMenu for this. The tutorial has a relevant section (see below). The mouse button that triggers the popup, the popupTrigger, varies by platform.i havent find any way to process whether the MouseEvent input is a left or right click
One of the easier ways is with SwingUtilities. It has three methods, eg, SwingUtilities.isLeftMouseButton(aMouseEvent). The MouseEvent api has more info in the comments section.
Aside from the focus problem (see below) this might be difficult. You could try working with the MouseInfo and PointerInfo classes (j2se 1.5+). And the other helpful resource is again SwingUtilities which has some convenience methods such as convertPointToScreen.none of the MouseMotionListener implementation worked at all
Focus is an issue beginning with j2se 1.4. Look in the Window class api for the method isFocusableWindow. For the window, its JRootPane or any child components to be able to send Input/MouseEvents it/they must have the focus. This method lists the requirements for this to happen.
Here are a couple of links into the tutorial that may be helpful.How to Use Menus
esp, Bringing Up a Popup MenuHow to Use the Focus Subsystem
esp, Making a Custom Component Focusable