Results 1 to 2 of 2
  1. #1
    fatabass is offline Senior Member
    Join Date
    Nov 2011
    Blog Entries
    Rep Power

    Default Help with mouse listener please.

    Hi everyone,

    I have a JFrame mainFrame, which has a JMenuBar mainMenuBar.

    My mainFrame is undecorated, so I want to add a MouseListener to my mainMenuBar, and let the user move the JFrame as desired by holding the mainMenuBar.

    Can you help me with:

    How can I get where the mainFrame is at the moment when mouse is click on the mainMenuBar ?
    How I can track, how far in which direction the user moves the mouse and put the mainFrame in that location ?

    Where should I start from ?

    Thank you.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Washington, DC
    Rep Power

    Default Re: Help with mouse listener please.

    I assume you started by reading this tutorial: How to Write a Mouse Listener (The Java™ Tutorials > Creating a GUI With JFC/Swing > Writing Event Listeners)

    If so, what exactly have you tried so far? Where exactly are you stuck?
    How to Ask Questions the Smart Way
    Static Void Games - GameDev tutorials, free Java and JavaScript hosting!
    Static Void Games forum - Come say hello!

Similar Threads

  1. Need some help with mouse listener
    By Serialcek in forum AWT / Swing
    Replies: 8
    Last Post: 01-07-2012, 10:20 AM
  2. Mouse listener
    By chetoos in forum Advanced Java
    Replies: 3
    Last Post: 06-23-2011, 09:23 PM
  3. Need Help with Mouse Listener!!!!
    By Doggir in forum New To Java
    Replies: 11
    Last Post: 05-05-2011, 11:48 PM
  4. Mouse Listener
    By Quizerno in forum New To Java
    Replies: 8
    Last Post: 03-17-2011, 05:25 AM
  5. Mouse Listener for mouse floating over object?
    By Krooger in forum AWT / Swing
    Replies: 1
    Last Post: 11-18-2009, 04:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts