Mouse Coordinates and using the getPoint method

Hello,
I have a mouseClicked event that uses the getPoint method to get the coordinates of the mouse. Because the mouse is a shape (the cursor), it contains more than 1 pair of coordinates, so getPoint is supposed to return the coordinates of what is called the "hit point" of the mouse. Now because I use the standard mouse cursor (an arrow), the "hit point" is supposed to be its point edge, but I get the coordinates of the other edge!
Now if I have a big JPanel in the window (without controls) that the user can press and the program needs to respond to the clicks, there are situations that the user presses somewhere and expects to get a specific response, but instead gets another one. That's because he/she is accustomed from other applications to use the point edge, but if the 2 edges of the cursor are in different regions in the panel (and thus generate different responses), they get the response of the other edge's region.
Is there a way to solve this?
Thanks.

I still don't understand your problem and apparently nobody else does either since there are no responses. Why don't you write a simple program (like I did for you on your last post) that demonstrates the problem.
"A picture is worth a thousand words".

Similar Messages

  • I can't turn on my MacBook Air despite trying to hold down the power button and using the SMC method. BTW my battery charger lights up to a green when plugged into the laptop.

    I can't turn on my MacBook Air despite trying to hold down the power button and using the SMC method. BTW my battery charger lights up to a green when plugged into the laptop.

    Hello cass528,
    I would be concerned too if my MacBook Air would not power on.  I recommend following the steps in this article when experiencing an issue like this:
    Troubleshooting: My computer won't turn on
    http://support.apple.com/kb/TS1367
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Edit entity object and use the Create() method for generating ID's

    Hello,
    I have and InserPage.jsp and defined the datasoucre correctly.
    <jbo:InputText datasource="ds" dataitem="Clientid" /> gives me
    the unique ClientID from the FIRST client-record in my table ,
    although this page is for inserting a NEW Client, with a new
    ClientID.
    So, on the Clients Entity i made a create() method and put the
    following code in it:
    public Number getClientid() {
    return (Number)getAttributeInternal(CLIENTID);
    public void create(AttributeList attributeList) {
    SequenceImpl seq = new SequenceImpl
    ("Clientid",getDBTransaction());
    Integer i=(Integer)seq.getData();
    setClientid(new Number(i.intValue()));
    super.create(attributeList);
    the getData() Returns a sequence value, but what sequence value?
    Do i have to create a sequence on the ClientID column in my
    Oracle Table in the DB too?
    The problem is, the first ClientID # is 819 and the current last
    one seems to be 2899, so how do i achieve that when opening the
    insert.jsp the new ClientID shows up (ie. 2900)?
    How can i achieve this?
    thx

    OK, managed to track down the HowTo on triggers? I created the
    trigger.
    create sequence client_seq
    start with 8900
    increment by 1
    nomaxvalue
    nocycle;
    I changed the create() method for the entity object to:
    public void create(AttributeList attributeList) {
    SequenceImpl seq = new SequenceImpl
    ("Clientid",getDBTransaction());
    SequenceImpl s = new SequenceImpl("client_seq",
    getDBTransaction());
    Integer next = (Integer)s.getData();
    setClientid(new Number(next.intValue()));
    and running the tester for the module works fine. ;-)
    But...
    The Insert.jsp page has to insert/show this sequenced value!
    After i defined the datasource and let us say:
    <jbo:InputText datasource="ds" dataitem="Clientid" />
    ...the number 819 shows up, which is the FIRST record, so i do
    not get the new ClientID with the correct number.
    Any help is always nice. ;-)

  • HT1918 First time trying to buy from iTunes and I received a message that my payment was declined. I was using the MasterCard method. Help

    First time trying to buy from iTunes and I received a message that my payment was declined. I was using the MasterCard method. Help

    Is this a debit card you're trying to use? If so, those are apparently no longer accepted by the iTunes Store. You need to use a true credit card. If you are using a credit card, make sure all your billing details match your bank statement exactly. If that doesn't help, call your credit card company and ask if they can see any sort of flag on your account that might cause your card to be declined.
    Regards.

  • Get mouse coordinates and fire bullet.

    So far here is my code in the fla:
    import flash.events.MouseEvent;
    Mouse.hide();
    main_crosshair.startDrag(true);
    main_crosshair.addEventListener(MouseEvent.MOUSE_DOWN, crosshairFX);
    function crosshairFX (e:MouseEvent):void{
              var projectile:bullet = new bullet();
              addChild(projectile);
              main_crosshair.gotoAndPlay(3);
              trace(crosshairX);
              trace(crosshairY);
    and this is my bullet.as :
    package {
              import flash.display.MovieClip;
              public class bullet extends MovieClip {
    Im trying to figure out how ot make it so that when I click my mouse it fires the bullet from the bottom right of the screen towards my cursor. That is the part I need help with now then I;m going to try and figure out myself how to test if an object is hit. Thanks in advance for any help.
    var PositionY:Number;
    var PositionX:Number;
    var crosshairX:* = Mouse.x;
    var crosshairY:* = Mouse.y;
    stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
    function onMouseMove(e:MouseEvent){
              var target:* = e.target;
              var location:Point = new Point(target.mouseX, target.mouseY);
              location = target.localToGlobal(location);
              PositionY = location.y;
              PositionX = location.x;

    Since you basically want to shoot something at an angle, the code should be pretty much the same.  You know where the origin of the bullet is (projectile.x/projectile.y) and you know where the destination points are (mouseX/mouseY).  That tutorial will help  show you how to use the Atan2 method to make an object travel from one place to another.

  • How do I use the find method to find multiple items in a single paragraph?

    I am desigining a script to find any instances where ctrl+b and ctrl+i are applied to body text and then replace those character format overrides with Italic or Bold chartag.  Here's what the script is supposed to do:
    put the find method in a while loop that searches for character format overrides.
    If a character format override is found, pass the text range returned by the find method and the CharPropsChange flag to the GetTextForRange method.
    Use a boolean compare between the idata of the text item to the character angle and character weight constants.
    Whichever boolean evaluates to true, then use the SetTextProp method to set properties of the text range to the properties of the italic or bold character tag.
    This script does work on the first character format override found however it ignores any other overrides in the same paragraph. The cause of this is that the while loop updates the text loc that the find method uses to the next paragraph in flow. I suspect that i need to add an inner loop that goes through all the text in a single paragraph, where at teach iteration the text loc used by the find method is based on the same paragraph but the offset is modified. I am just not sure how to do that.
    function removeOverrides (pDoc)
        var vDocStart = pDoc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;
        var vBoldFmt=getCharFmt (pDoc, 'Bold')
        var vItalicFmt=getCharFmt (pDoc, 'Italic')
        initFA_errno ();
        while (FA_errno==Constants.FE_Success)
            var vTextLoc = new TextLoc(vDocStart,0);
            var vFindParams=findOverrideParams (pDoc);
            var vTextRange=pDoc.Find(vTextLoc,vFindParams);
            if (vTextRange.beg.obj.ObjectValid())
                var vTextItems=pDoc.GetTextForRange (vTextRange, Constants.FTI_CharPropsChange)
                if (vTextItems.length==!0 )
                    if (vTextItems[0].idata==Constants.FTF_WEIGHT)
                       pDoc.SetTextProps (vTextRange, vBoldFmt.GetProps())
                    if (vTextItems[0].idata==Constants.FTF_ANGLE)
                       pDoc.SetTextProps (vTextRange, vItalicFmt.GetProps())
                    } else (Log (vLogFileName, '\nERROR: No items were found in the text format array but format override was found: '+pDoc.Name))
            vDocStart=vDocStart.NextPgfInFlow;
    function findOverrideParams (pDoc)
        var vFindParams = AllocatePropVals(1);
        vFindParams[0].propIdent.num = Constants.FS_FindObject;
        vFindParams[0].propVal.valType = Constants.FT_Integer;
        vFindParams[0].propVal.ival = Constants.FV_FindCharacterFormatOverride;
       return vFindParams;

    Hi Rick,
    Well, following up on the previous posting, I actually did figure out how to make it work but it seems rather inefficient. I can insert a new paragraph right after the paragraph that has the table anchor but when i cut the table, i also cut the paragraph i just created. So to get around that, I create two paragraphs, so that there will be one paragraph left after i do the cut and that is the paragraph that I paste the table into. Once the table is pasted into the new paragraph, I delete the other paragraph that I created.
    Here's the updated code from the for loop:
    var vTbl = vDoc.GetUniqueObject(Constants.FO_Tbl, vTextItems[i].obj.Unique);                 
    var vAnchorPgf=vDoc.NewSeriesPgf (vTbl.TextLoc.obj)      
    var vAnchorPgf2=vDoc.NewSeriesPgf (vAnchorPgf);        
    var vAnchorTextLoc=new TextLoc (vAnchorPgf2, 0);             
    var vTblTextRange=new TextRange ();        
    vTblTextRange.beg.obj=vTbl.TextLoc.obj;       
    vTblTextRange.beg.offset = vTbl.TextLoc.offset;        
    vTblTextRange.end.obj=vTbl.TextLoc.obj;        
    vTblTextRange.end.offset = Constants.FV_OBJ_END_OFFSET                 
    vDoc.TextSelection=vTblTextRange;        
    vDoc.Cut (0);                
    vTblTextRange.beg.obj=vAnchorTextLoc.obj;        
    vTblTextRange.beg.offset = 0;              
    vTblTextRange.end.obj=vAnchorTextLoc.obj;       
    vTblTextRange.end.offset =0;                 
    vDoc.TextSelection=vTblTextRange;       
    vDoc.Paste (0);                   
    vAnchorPgf2.Delete();        

  • There is no printer output when using the PrintOut method

    I have a VB6 app with CR XI, and a customer found a situation that when printing a report directly to the printer using the PrintOut method, there is no printer output or error message.
    Some reports using the same code print normally, but a report that is preceded by another print call, presents this behavior.
    And when the output is directed to the screen, we can see the report.
    Could someone give me an idea of what is the problem?
    Thanks,
    Isis
    SP - Brazil
    The code used is below:
                       Set rpt = applic.OpenReport(App.Path & "SEFoto" + TipoRPT + ".rpt")
                       rpt.FormulaSyntax = crCrystalSyntaxFormula
                       rpt.FormulaFields.GetItemByName("Empresa").Text = "'" + Company + "'"
                       rpt.FormulaFields.GetItemByName("Idioma").Text = "'" + Idioma + "'"
                       rpt.FormulaFields.GetItemByName("Versao").Text = "'" + Versao + "'"
                       ' ... Some lines to compose the selection formula
                       rpt.RecordSelectionFormula = Cond
                       ' To evaluate the image length:
                       Arq = rsTMP3!FT_Arquivo
                       ImageScaling = FatorDeReducao(Arq, "F")
                       ' To reduce the image length:
                       AchouOLE = False
                       For Each oSection In rpt.Sections
                           For Each oObject In oSection.ReportObjects
                               If oObject.Name = "PictureFoto" Then
                                  Set oOleObject = oObject
                                  AchouOLE = True
                                  Exit For
                               End If
                           Next oObject
                           If AchouOLE Then Exit For
                       Next oSection
                       With oOleObject
                            .Suppress = True
                            .XScaling = ImageScaling    ' 0.5 = 50%, 1 = 100%
                            .YScaling = ImageScaling
                            .Suppress = False
                       End With
                       Aguarde.Show 1
                       If DestinoRel = 9 Or DestinoRel = 1 Then ' Padrão ou impressora
                          rpt.PrintOut True              ' <<<---- Here using true or false nothing happens
                       Else
                          PrintRPTtela rpt, "Fotos"   ' <<<--- Here it works fine
                       End If

    Hi Isis,
    Not sure if you have applied any service Packs to CR? If please do so and test again. Then you can upgrade to CR XI R2 for free, use your XI Keycode and download Service Pack 4 from this link:
    https://smpdl.sap-ag.de/~sapidp/012002523100011802732008E/crxir2_sp4_full_build.exe
    You'll find the distribution files for your app also from that same download area.
    If you don't want to upgrade to XI R2 then download all patches from XI and test again. This issues rings a bell that it may have been fixed.
    Thank you
    Don

  • Adding a pre-existing podcast to iTunes U using the feed method.

    While trying to add another pre-existing CSULB podcast to our CSULB on iTunes U (using the "feed" method), I encountered an error message that I don't know how to interpret.
    Can you help me with this or is there somebody else at Apple I should work with?
    The pre-existing podcast is at: http://www.ccpe.csulb.edu/citt/podcast/feed.aspx
    The error message reads:
    "While attempting to download. . . iTunes U encountered an authorization error and could not update the content. Verity your authorization access to the feed specified in the feed URL field, including the user name and password permissions, and then try again."
    I have no idea what this means. Can someone please help?
    Walter

    bgerth wrote:
    Is anyone using Podcast Producer 2 to publish content on iTunes U, and if so, does it work reasonably well (do you recommend using it)?
    Its spiffy. I like it, but I'm a softie when it comes to Apple stuff.
    Am I correct in thinking Podcast Producer 2 can only be used to create an RSS feed to point to podcasts stored in its Podcast Library or can you use Podcast Producer to upload files into our institutional iTunes U storage space (yes we are fortunate to have access to Apple's 500 GB storage space)?
    You can choose to do either. Although I haven't seen anything official, I suspect that Apple prefers the use of Podcast Library…but that's just a preference, not any sort of recommendation or future direction. In the end, I suggest (and I think Apple would agree) that you do what makes the most sense for you. For example, we choose to do it both ways.
    Can you provide a link to instructions (or explain how to either identify in iTunes U that the podcast is in Podcast Producer's Podcast Library as an RSS Feed or how to upload the podcast from Podcast Producer to a specific tab in a specific iTunes tab.
    I believe someone (a friend from Apple…??) released a PcP workflow action that deals with iTunes U the same way as PcPv1 did. Overall, though, probably the best kept PcP secret is that Podcast Producer is a generalized workflow solution. Sure, it's cast as a podcasting solution…but if you can get OS X Server to do something, you can get Podcast Producer to turn it into a workflow…anything. Since OS X Server can be scripted to upload content to iTunes U, Podcast Producer can handle that too.
    I appreciate any information given as I have tried with little success to find this information in either the iTunes U or Podcast Producer Admin guides.
    Thanks!!
    BGerth

  • Trying to use the Instance Method

    I'm trying to get the second class to use the instance method in the first class to make some Turtles move around in Triangle shape.
    Class one code:
    public class TryInstanceMethod
    private Turtle t;
    public TryInstanceMethod(Turtle turtle)
    t = turtle;
    public void drawTriangle(int length)
    t.forward(length);
    t.turn(-120);
    t.forward(length);
    t.turn(-120);
    t.forward(length);
    Class two code:
    import java.awt.*;
    public class UseInstanceMethod
    public void main(String[] args)
    World w1 = new World();
    Turtle t1 = new Turtle(w1);
    TryInstanceMethod TM1 = new TryInstanceMethod(t1);
    TM1.drawTriangle(100);
    World w2 = new World();
    Turtle t2 = new Turtle(w2);
    TryInstanceMethod TM2 = new TryInstanceMethod(t2);
    TM2.drawTriangle(200);
    it compiles fine but it will not use the instance method drawTriangle to draw two triangles in two different worlds

    When posting code highlight it and click the CODE button to retain formatting
    fox_1 wrote:
    it compiles fine but it will not use the instance method drawTriangle to draw two triangles in two different worldsSo what does it do instead? We do not read minds and cannot see you computer screen. So you need to provide as much information as possible. Such as the Turtle and World classes.

  • How to know the size of the string with out using the length() method

    i want to find the lenght of the
    String s="Sudha";
    with out using the lenght() method.

    Not true (I mean the part about "The only String
    call"). But if it had been true, I might haveagreed
    with this:
    Assuming one uses the 'exception' approach thenwhat
    method other than charAt() is needed?I probably misunderstood your post, I thought you
    meant that the only alternative to length() would be
    charAt() and catching the exception.There are many ways and if the teacher had said find 5 ways of finding the length of a String then I would have fealt happier because it would have meant the student would have to read and study the whole of the String API.
    I like
    int length = (s+"sabre").lastIndexOf("sabre");

  • Cs3 curve adjustament layer , can i zoom and use the hand too ?

    Hi
    i have a question about cs3 , under xp
    i add a curve adjustament layer ,-> curve dialog (window) open ->  well i can zoom with the mouse wheel
    but if i keep the space keyboard pressed , i can't use the hand tool
    when i click the space keyboard , it works like the [ok] button , in short if like i click on ok and close the window
    is there a tip to use the curve adjustament layer , zoom and  use the hand tool
    thanks
    cheers

    That's the behavior you would expect in general when using the space bar while a dialog is open in Windows, since the space bar is normally expected to operate the default button - [OK] in this case.  Just for thoroughness I did reproduce the issue with Photoshop CS3 just now, just as you described.  I don't believe there's any workaround.
    This is likely one reason why Adobe implemented the new Adjustments Panel in Photoshop CS4 to replace that dialog entirely.  In PS CS4 and newer you get the functionality you desire - that of having the space bar invoke the Panning feature, even though you may be changing the parameters of an Adjustment layer.
    -Noel

  • Address bar and menu bar hidden unless I expand page and use the pointer

    I am a new user of imac.  Can you please help me - the menu bar and address bar and search bar does not show when I open Safari.  I can get it if I expand the page and use the pointer to point at the top of the screen.  This is the only way I can use it now.  I hope you can help I am not too savvy yet on this lovely machine.

    If you are using Lion OSX, they have implemented a full page feature for many programs.  If you are running it full screen (like it sounds like you are) then you just move your mouse up to the top of the page for those items to appear.  If you don't like full page, there is a button in the top right corner (it has 2 arrows pointing at each other) and you can click that and bring it back to the normal mode.
    Hope that helps.

  • HT4623 I have tried to update my iPhone using the iTunes method but it will not work. The message "The iTunes update server could not be contacted. Please check your internet connection or try again later," appears. What do I do? The Internet is working f

    I have tried to update my iPhone using the iTunes method but it will not work. The message "The iTunes update server could not be contacted. Please check your internet connection or try again later," appears. What do I do? The Internet is working fine.

    Have you tried the following troubleshooting document?
    iTunes for Windows: iTunes cannot contact the iPhone, iPad, or iPod software update server
    If you end up using the If the iTunes Store opens successfully section of the document, and the "Automatically detect settings" checkbox is already checked, try unchecking and rechecking it and clicking OK.

  • Using the ContactInsertOrUpdate method from the ContactWS but error msg rcv

    [This thread was migrated from the On Demand Developer Forum in the old Siebel Community]
    Corsa
    Contributor
    I am getting the following error I do not know why or how to work around
    it.
    Method 'SetFieldValue' of business component 'Contact' (integration
    component 'Contact') for record with search specification '[External <br/>
          System Id] = "123456"' returned the following error:"Access <br/>
    denied.(SBL-DAT-00542)"(SBL-EAI-04375)
    Does any out there have any ideas?
    Previously when I tried to do the same action I got the following message:
    Multiple matches found for instance of integration component 'Contact'
    using search specification '[External System Id] = "123456"' in the
    business component 'Contact', based on user key 'Contact User
    Key:3'.(SBL-EAI-04390)
    Both messages are baffling me. Please, please help
    Product: CRM OnDemand
    06-16-2006 04:35 AM
    Re: Using the ContactInsertOrUpdate method from the ContactWS but error
    msg rcvd
    BigSlick
    Valued Contributor
    Hi Corsa,
    Can you access the record in the online application. Perhaps someone has
    changed the access rights for this Contact on the Contact Team ?
    -BigSlick
    06-20-2006 12:33 PM
    Re: Using the ContactInsertOrUpdate method from the ContactWS but error
    msg rcvd
    Corsa
    Contributor
    I realise now that the field AccountID is readonly and cannot be assigned.
    I was attempting to assign contactsList[count].AccountId to a value . I
    believe, this is the reason I was getting the access denied error.
    06-23-2006 11:10 AM
    ==============================================================================
    Click on the board or message subject at the top to return.

    Ok, so I hit a bump in the road. Just when I think I understand something It doesn't work correctly.
    I implemented it I thought correctly. I looked up something on the sun website (core java) I used advice from here, and my professor finaly responded to me with almost identical instructions. So I did it
    my RationalNumber.java no looks like this.
    public class RationalNumber implements Comparable
    //.....Break to new section
      public  float compute ()
           float value = getNumerator() / getDenominator();
         return value;
       public int compareTo(RationalNumber op2)
           if (Math.abs(compute() - op2.compute()) < .0001)
              return 0; //Equal
          if (compute() > op2.compute())
            return + 1; //Rational Number bigger
          if (compute() < op2.compute())
               return - 1; //Rational Number Smaller
         }I thought that would work fine, but it gives me an error when I compile it:
    RationalNumber.java:8: RationalNumber is not abstract and does not override abstract method compareTo(java.lang.Object) in java.lang.Comparable
    public class RationalNumber implements Comparable
           ^So now what, making it abstract only creates more errors....
    Also, thanks ChuckBing, I'm glad you like the screen name, I've been using it for years.

  • Drop Shipments costing of Inventory using the average method.

    How does the system handles the costing of inventory using the average method during dropshipments?
    One of my prospects uses average costing method for the accounting of their inventory. The issue now is, how does the system compute s for the cost since the goods/inventory is delivered directly by the supplier to the customer? What is the basis for the amount to be posted in COGS? Thanks!
    null

    For Drop shipments two inventory movements are still performed. When the goods are initially received (albeit logically), Oracle Inventory immediately issues them out of stock again - just as if you had ship confirmed them. Therefore you inventory accounting is also the same, and will use the purchase price of the goods as the inventory value.

Maybe you are looking for

  • JRE crash when printing

    I have an application that was written in Java 1.3 and prints successfully on a number of installation networks. On one site, whenever I print the JRE crashes. They use version java 1.5 which I have tested on my development system and have printed ok

  • How can I download previous music purchases in iTunes

    There seems to have been a glitch in one track of an album purchased from the Store. On advice at an Apple retail store I deleted the tracks from the album (with the intent of re-downloading the album hoping for a clear download) and yet when I check

  • Primary keys and resultSet .insertRow()

                artistsResults.moveToInsertRow();             artistsResults.updateString(1,newName);             artistsResults.updateString(2,newGroup);           //  artistsResults.updateString(3,newCV); // THINK ABOUT USING BLOB.             artistsR

  • VNC icon appears on client in list

    I have just installed Remote Desktop and updated the ARD client software on all of the eMacs in my media center. Today when I looked at the list of computers, one of them had 'VNC' and 'VNC ON' listed. What does this mean? Looking at the permissions

  • Exe not in extracted files

    Hello , I have just downloaded the Windows version of 2.1 (2.1.0.63.73). However, after extracting all the files in the ZIP, there is no sqldeveloper.exe file. Has anyone else come across this? Thanks, Garrie Edited by: Garrie on Jan 29, 2010 1:47 PM