Results 1 to 3 of 3
  1. #1
    nfw
    nfw is offline Member
    Join Date
    Feb 2010
    Posts
    2
    Rep Power
    0

    Default How to get a reference to a JInternalFrame's title bar?

    I would like to be able to perform hit detection on a JInternalFrame's title bar. I'm developing an application for a specialized input device, and having mouse dragging doesn't meet my requirements.

    I have a listener that gives me the coordinates of an input, and, based on those coordinates, I would like to be able to see if I have hit the title bar so as to invoke a "dragging" function.

    For the rest of my app's needs, I have used Swing's getComponentAt function to find out what is being hit.

    Thanks in advance.
    Last edited by nfw; 02-08-2010 at 11:26 PM.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,202
    Rep Power
    19

    Default

    (Untested) Try this:
    Java Code:
    ((BasicInternalFrameUI) internalFrame.getUI()).getNorthPane()
    db

  3. #3
    nfw
    nfw is offline Member
    Join Date
    Feb 2010
    Posts
    2
    Rep Power
    0

    Default

    That does indeed work!

    Unfortunately, I've found that the problem lies in my input device SDK, so it is still unsolved. I've found a workaround that I'll use in the meantime.

    Thanks!

Similar Threads

  1. String Title case
    By bugger in forum New To Java
    Replies: 6
    Last Post: 01-31-2012, 01:21 PM
  2. set * at tab title
    By keffie91 in forum Advanced Java
    Replies: 7
    Last Post: 10-06-2008, 07:21 PM
  3. Hiding the frameís title bar
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-21-2007, 08:41 AM
  4. How to alter the title of JOptionPane
    By mew in forum New To Java
    Replies: 2
    Last Post: 12-17-2007, 10:39 AM
  5. How can I add an ICON on a JDialog's Title-Bar?
    By iimasd in forum AWT / Swing
    Replies: 2
    Last Post: 11-06-2007, 12:54 PM

Tags for this Thread

Posting Permissions

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