Controlling Popup location within JTextArea

Probably a simple answer to this question. I'm wanting to display a simple popup when a user right clicks the mouse within a rather large JTextArea. I use the mouse event getX() and getY() methods to specify the preferred location of the popup in the getPopup() method, but the location seems to be relevant to the screen rather than the actual component (JTextArea).
How can I ensure the popup appears at the location the user right clicked the mouse button?
Code within MouseListener (registered with JTextArea) looks as follows:
buttonPanel = new JPanel();
clearButton = new JButton("Clear");
buttonPanel.add(clearButton);
pup = (PopupFactory.getSharedInstance()).getPopup(c, buttonPanel, e.getX(), e.getY());
pup.show();

I see. I tried it and may this will help
Point p = moueEvent.getPoint();
SwingUtilities.convertPointToScreen(p, jta);
Popup pop = (PopupFactory.getSharedInstance()).getPopup(textarea, panel, p.x, p.y);

Similar Messages

  • Why is there no control to turn off location services?  I updated my iPhone 4 to iOS6.0.1.  I now have no control over location services.  Will it always be on and only activate if an application requires it?

    I updated my iPhone 4 to iOS6.0.1.  I now have no control over location services.  Will it always be on and only activate if an application requires it?  I want to be sure it will not drain the battery unnecessarily.

    I found this answer in ios 4, but it worked on the ios 6 on my iphone 4:
    moodogg
    Currently Being Moderated  Re: iPhone 4 / iOS 4 - Location Services Always On
    Nov 20, 2010 10:25 PM (in response to modular747)
    so i actually ended up walking into genius bar today. they couldn't figure out which program was causing the glitch either, but the way they solved it was by resetting all the location service permissions altogether. for those of you who want to know how to do this, navigate to "settings > general > reset > reset location warnings". also fyi, the apple service rep told me the purple location service icon next to each app simply signifies that particular app has requested your location within the past 24 hours, not necessarily that the app is active. hope this helps those with the same problem as i had.  iPhone 4, iOS 4
    I will mention that I did not have the problem until I downloaded the new googlemaps, which I have deleted off my iphone.

  • How do I move a page to a new location within iBooks Author?

    I've just started to play around with iBook Author, and I can't seem to discover how I can do something as basic as move a page to a new location within the chapter, or outside the chapter for that matter.  It won't allow me to drag and drop it, and there is no menu selection for it.  I also would like to be able to insert a new page at the current cursor location, and that doesn't work either.
    Has anyone had any luck doing either of these tasks?

    You can't. You can move entire chapters or sections but can't move individual pages because of the reflow capability. It is mentioned in the help and the FAQ I believe.

  • Hyperlink to a location within a page

    Hi,
    I'm trying to create a way to hyperlink to an image WITHIN a long page. Is there any way to make a link that "jumps" to a given location within a page, instead of to the top of the page?
    I'm using iWeb Version 1.1.1
    Thanks

    http://www.varkgirl.com/Anchors

  • Process Message failed: System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.

    Hi
    I am trying to process an X12 message and I am getting following error.
    Method : ProcessMessage
    Message : Process Message failed: System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
    Parameter name: length
       at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
       at Q.Inbound.X12Preprocessor.getTranTypeFromFuncCode()
       at Q.Inbound.X12Preprocessor.setProcessType()
       at Q.Inbound.X12Preprocessor.getFuncGroupHeader(StreamReader sr)
       at Q.Inbound.X12Preprocessor.ProcessMessage(X12Definition& docInfo)
    Please help.
    Thanks

    Might try them over here.
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=csharpgeneral%2Cvbgeneral%2Cvcgeneral&filter=alltypes&sort=lastpostdesc
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • How to control the location of Iconified JInternalFrame?

    Is there any way to control the location of Iconfied JInternalFrame on JDesktopPane? I've searched API reference and tried to find suitable methods to override in UI classes. But I still cannot figure out how to do it after a long time. Who have any ideas about it? Thank you very much.

    DefaultDesktopManager.iconifyFrame(...);

  • Connecting my iPod to my Car's 30-pin Dock but Being Able to Control It from Within the iPod?

    I have a 5th Generation iPod nano. I own a 2008 VW Eos which has a 30-pin dock. It functions but, my car's UI for iPod is nefastous. I wanted to know if there was a way to control the music within the iPod.

    Not using the dock connection.  That is for data, and your car audio system is "in charge" of playing the songs.  However, if the car audio system has an auxiliary audio input that is a standard mini-stereo jack (looks like headphones jack), you can connect the iPod there using a commonly available cable, like this
    http://www.amazon.com/Monster-iCable-Auxiliary-Discontinued-Manufacturer/dp/B002 AR5XIK
    Then, play your iPod through the car's speakers.

  • Controlling iTunes from within Keynote 2?

    Is it possible to control iTunes from within Keynote, when I'm using the presentation tools? I haven't been able to make it work, and it is an essential part of being able to use Keynote in my lectures. It would be nice to switch from Powerpoint.
    Right now, I'm using Synergy to control iTunes, and PPT lets me do it, but control keys/functions seem to be locked out in Keynote. Am I missing something?
    Thanks for any help,
    Geoff

    Games often hardwire their keyboard functions into the code which means you can't change them,and they override your own settings.
    The best option I can suggest is playing Urban Terror from a new user account on your Mac, in which you remove all Dashboard widgets and add the iTunes widget. A quick click of your mouse scroll wheel while playing Urban Terror will bring up Dashboard (you may have to set this in advance) and while that is not quite "ingame" it is as near as you will get... unless someone else has a better idea.
    (I am assuming that you don't want to use Command-tab to switch to iTunes itself while you are playing?)

  • HT5654 Where is the Help button located within Itunes on a windows computer?

    Where is the Help button located within Itunes on a windows computer?

    It's in the top right corner of the app, like where you would see it in other apps.
    You should able able to find the info your looking for here too.

  • HotFixes for autocomplete popup location

    Hi ,
    As you all know the popup location is appearing outside the grid panel when u place ajax autocomplete ajax component inside grid panel/ table / group panel .
    i wonder when the hotfixes for this will be ready or is there any workaround?
    Thanks.

    yea.
    i think that is the problem.
    i have a autocomplete textfield under groupPanel and this groupPanel is located under gridPanel
    and the resultiing popup list is located outside the panel itself.
    Thanks.
    Can u refer me to the bug URL?
    is there any workaround for this?
    Thanks

  • How do I keep account of line and column number within JTextArea?

    How do I keep account of line and column number within JTextArea?
    Thanks.

    hi kamlesh,
    to get the number of columns in a JTextArea u have the function
    getColumns() which gives u the number of columns in the text area.
    To get the number of rows present u have the function
    getRowCount() which returns an int that specifies the number of rows in the text area.
    Hope this helps
    Cheers :)
    Nagaraj

  • DBCA -control file locations in template

    Windows Server 2003 Enterprise. Oracle 9.2.0.6 With Oct 2005 patch.
    I'm trying to place my control files in an alternate shared location as required for using Oracle Failsafe. The editor allows me to make changes but when I view the template and the scripts created the control file location is the default.
    Have I missed a prerequisite step before energizing DBCA or is there a problem with the tool that I need to open a TAR for?
    Thanks in advance for your help!
    Darrell

    This was in regards to the initialization parameters being edited in the DBCA. I found one workaround and one solution.
    The DBCA was always taking the default {ORACLE_BASE} despite what was being displayed in the edit screen.
    Workaround= Build your templates on a server where the {ORACLE_BASE} is defined as the target location you want and then move the template to the machine where you plan to build the instance.
    Solution= Redefine the {Oracle_Base} value in the file initialization variable section during the creation of your template. It shows up as a default(unchangeable) but it allows you to reenter it with your desired value and override the default.
    Hope this helps someone else down the road!
    Darrell

  • TS1589 my airport stopped working when i changed its location within the same network (wired)

    Please help....I replaced my airport express with an apple tv and moved the airport to a different location within the same wired network and the light continues to flash amber. I know the ethernet connection is good and I have tried restarting the modem/router/airport with no change in status and when I look in the airport utility software, it reports that it cant see it. When I move back to its original location, the light goes green.  What happened and how can i correct this issue? Thanks very much for any assistance.

    the weird thing is that all Ive done is move its pysical location....my house has ethernet ports in every room all running through a common upstream router which in turn is connected to a dsl modem. At this point Ive hard reset the AX back to factory settings....now the AX utility sees the AX but shows me that it has a total of 3 problems. 1) Internet connection...2) no DNS servers...3) default settings. When I highlight "default settings" the info reads "this AX base station has default settings. You should configure it to connect to the internet, secure the wireless network, and provide a password. I assume that if I correct this, the other 2 troubles should take care of themselves.  At the bottom of the page there are buttons that say...help, revert, update and a drop down menu that says default settings, recovered settings, create profile, edit profiles. not sure where to go from here. thaks for taking the time to help me.

  • How would 2 people call each other using facetime if both were in a foreign country but staying at different locations within that country?

    How would 2 people call each other using facetime if both were in a foreign country but staying at different locations within that country?

    It's tied to the Apple ID also - I believe it would use that to find the right person/device.
    Perhaps this article would help: http://support.apple.com/kb/HT4319. It looks like you may want to go in through your contacts and make the call.
    If you're concerned about data charges, put your phone in Airplane mode before trying to Facetime. That will prevent it from trying to make a call over your cellular data.
    ~Lyssa

  • How do I control the location of an external swf?

    Hey again,
    Sorry this probably seems rudimentary, but how do I control
    the location of a swf I load into my main movie? I'm trying to load
    in a slideshow and am having a hard time getting it where I want it
    to be. Thank you so much in advance. Again sorry for the ignorant
    posts.
    Dave

    tyrione wrote:
    > Hey again,
    >
    > Sorry this probably seems rudimentary, but how do I
    control the location of a
    > swf I load into my main movie? I'm trying to load in a
    slideshow and am having
    > a hard time getting it where I want it to be. Thank you
    so much in advance.
    > Again sorry for the ignorant posts.
    >
    > Dave
    >
    the only way to control it is to define the right path to
    your loaded files.
    There really isn't any other way. If the file is in a folder,
    it has to be in
    your path folder/name.swf
    Best Regards
    Urami
    "Never play Leap-Frog with a Unicorn."
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

Maybe you are looking for