Results 1 to 2 of 2
  1. #1
    fatabass is offline Senior Member
    Join Date
    Nov 2011
    Location
    Turkey
    Posts
    380
    Blog Entries
    24
    Rep Power
    4

    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
    Location
    Washington, DC
    Posts
    4,037
    Rep Power
    10

    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 - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

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