Question involving getlocation / set location

Hello,
So here's my problem... For simplicities sake, I'll just skip to the point. I'm trying to make an shape move from where it is on the screen but based on a fixed ratio. So I'm trying to take the location of object x, and increase it's x and y coordinates for its location by say 20%.
I'd like to be able to do something like this.
private int x;
private int y;
private int yprime;
private int xprime;
this.getLocation(x,y);
yprime = y*1.2;
xprime = y*1.2;
this.setLocation(xprime,yprime);The problem is I get an error message saying the shapes package I'm using cannot use the method getLocation(int, int), or something along those lines. What am I doing wrong!?
Edited by: ApeXX on Feb 15, 2010 6:17 PM

ApeXX wrote:
I'm sorry, I should have been more clear. I'm using a special package "wheels" designed for a learning java course. This shapes package does include a method called "getLocation".And hopefully has an api that you can use to see if you're calling the method correctly. As I noted above, does your code even compile? You seem to be trying to convert an int (xprime and yprime) into a double by setting it equal to a double. Or are xprime and yprime really double variables and this is why the compiler complains when you try to use them in getLocation or setLocation?

Similar Messages

  • AutoScrolling of PanelLayout and setting Location of dynamically created controls

    Hi, I have a question related to setting Location of dynamically created controls when my PanelLayout is scrolled down or up.
    So basically I have wrote a code that lets me drag on control over other other and replace their's locations.
    So I wanted to add possibility for user to dynamically add new controls (every new control is suppose to be 200px below previous) - everything is fine as long as I add them from upper section of my LayoutPanel (without scrolling) but when I try to add
    them while I'm half dawn scrolled they are placed based on CURRENT left upper corner which is NOT a upper left corner of LayoutPanel therfore they are placed with wrong padding based on current scrolled position.
    So my question is how can I avoid it and always add new controls based on LayoutPanel upper left corner? (I have already tried disabling AutoScroll while adding new control and enabling it back after adding - it works but I want to find PROPER way because
    I'm sure there must be some kind of solution to it)
    Thanks in advance.

    Hi darekg11,
    >> I have a question related to setting Location of dynamically created controls when my PanelLayout is scrolled down or up
    I am wondering what the PanelLayout was, was it a “flowLayoutPanel” or “tableLayoutPanel”?
    >> basically I have wrote a code that lets me drag on control over other other and replace their's locations
    Did you mean you drag the control at runtime or at design time?
    >> how can I avoid it and always add new controls based on LayoutPanel upper left corner
    I could not reproduce your issue, and could you share us some key code or a simple demo to reproduce your issue?
    I made a research about “scrolling panel”, and I think the link below might be useful to you:
    # Scrolling Panel
    http://www.codeproject.com/Articles/226381/Scrolling-Panel
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • Set location  - CR 8.5 vs CR XI

    I didn't find exact answer to my question.
    Short overview. CR layouts are used in ERP system just reading and formating data from SQL 2005 prepared by special stored procedures. Main clue is to use the same layout for production and test databases (with many different names).
    After link new table in CR 8.5 there was only a need to change 'Set location' -> 'Location: Table' from <database name>.dbo.<table name> to <table name> and it works fine.
    Now I'm switching CR layouts to CR XI R1 SP4 (the newest one supported by ERP) but can't find the same possibility like described for 8.5. All new tables based on OLE DB have 'catalog: <database name>' which I cant change. Even if 'Initial catalog' is empty there is always database name in table properties which causes building queries like 'select ... from <database name>.dbo.<table name>' instead of <select ... from <table name>'.
    How to enable behavior known from 8.5 in XI?

    Solution:
    Entering manually table name in 'Overridden Qualified Table Name' without database name solves the problem.

  • Question about email setting: how  do i change the setting so i need to login to check my email. Currently it automatically come to the inbox without the need to log in. Thanks

    Question about email setting: how  do i change the setting so i need to login to check my email. Currently it automatically come to the inbox without the need to log in.

    You don't. Email comes in either by push or when you invoke the email app. Ther is no password except when you first set up the account. If your iPad is not being used as your personal device and you need to shield emails from other users, then don't use the email app.  Instead, use web mail if available from your provider.

  • HT5312 I have never set up any security questions and now it is asking me for one.... how do you answer a question you never set up?????

    I have never set up a security quesiton and now it is asking me for one... i have set up 40 ipads so far without personal security info... how am i to respond to a security question i never set up????!

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Steps involved in setting up communication between CRM and R3 / ECC

    Hi all,
    Can you please tell what are the steps involved in setting up communication between CRM and R3 or ECC.
    I know that initially logical systems, RFC connections and other technical settings need to be done by Basis consultants.
    From a functional consultants viewpoint, what all config settings need to be done so that data transfer between the systems can take place?
    Thanks in advance.

    Hi,
    There are a series of steps that are to be done...
    These include creating sites and subscription in CRM, setting up filters, and number ranges....
    All these are in the connectivity guide C71 and replication guide B09.
    Refer C71 first and then B09. These would suffice.
    You can get these both in the follwoing reference:
    http://help.sap.com/bp_crmv340/CRM_DE/index.htm
    If you dont get, then gimme your email id, i shall forward these docs to you.
    Kindly reward with points in case helpful
    Sharif.

  • Get Siri to set location reminders (using multiple reminder lists)

    I found a way to get Siri to set location reminders using multiple reminder lists (but you can just use one list too):
    First make additional lists in the reminder app: click list button (the lines on the left) > edit > create new list > done. Make as many as you want. I have grocery, home, personal, business, family.
    Let's say you want a reminder to pick up apples when you get to the apple store. You must add the location in your contacts to your name in contacts.
    Do the following:
    In maps app find the location with search.
    Tap the blue arrow > Add to contacts > Add to existing contact
    Choose your name in contacts. It will be added under your address for home or work so you will need to edit it:
    Click Edit.
    Click on the small label on the left of the new address - it will just say "address"
    Scroll to bottom of page and click on Create custom label
    Enter the location name like "Apple Store". Click Done.
    Important Note: You will need to delete the url it adds under your home url section and maybe other things it messes up with the new contact info instead of yours - so check all the fields each time you do this.
    To make a location based reminder using a specific list you must open that list yourself - Siri will not open it for you.
    Example:
    Open grocery list yourself in the reminders app
    Tell Siri something like: "remind me to pick up apples" (Do not mention the location yet - if you do it will not work)
    Siri will ask: "When should I remind you?"
    Say: "When I get to the apple store"
    Siri will say she will remind you and you will see the location reminder in the grocery list.
    This is how it works for me but if you know an easier way let me know! This is beta so I'm sure it will get easier.

    I have one thing to add.  You don't have to open the list manually.  Tell Siri:  "Add to my <listname> list".  For example, if you have a list named "Work", tell Siri:  "Add to my work list".  Siri will reply, "What should I add to your 'Personal' list?
    and you can continue from there. 
    There is a syntax for doing all this in one sentence, but I find it only works about half the time. Too many fields for Siri to parse in her current Beta stage
    /d

  • Set Location of individual text box - report design

    Post Author: sonjeeva
    CA Forum: Crystal Reports
    Hi Guys,
    Is it possible to set location of an individaul text box to be at the end of report? I know if I have this at end of report area it would work. But my report has a sub report in end of report area and the text box doesn't appear at the end of both reports.
    Cheers
    Sonny

    Post Author: kcheeb
    CA Forum: Crystal Reports
    If you are creating the report through code (C#, VB etc.) you could get the location/size of the subreport and then set the text box location based on those parameters.
    I don't think it's possible from within the Crystal report designer itself. At least I couldn't find a place to do this.

  • Setting locations with your iPhone 4s

    I am pained to admit this, but I cannot figure out how to set locations in my iphone4s that I can set reminders to alert me to do whatever task I had previously set for myself to accomplish when I arrive at the noted location. What types of steps and preferences do I need to select and apply so I can hear Siri tell me as I pull into a lot or walk into a store at one place or another to be reminder of the "note to self" I created earlier to help ensure the purchase of specific goods or anything for that matter! Thanks for helping me out with the awesome function available on my phone that has done nothing but mock my ridiculous inability to master the ins &amp; outs of the program.

    Make sure you have an entry in your contacts for yourself that includes your work address. Then, go to Settings>General>Siri and make sure that your contact is selected for "My Info". For other locations, make sure that there is a contact with the correct address.

  • Set location of components and reduce the size

    I want to resize JavaFX component and shrink the components which are next to it. Here is the result which I get:
    When I click on the angle of this component I can resize it down and right.
    http://i.stack.imgur.com/jqoNW.png
    The components which are next to it are pushed down and right. Part of them are behind the visible part of the screen.
    http://i.stack.imgur.com/rsi0L.png
    All components are placed in BorderPane,VBox,HBoxand againBorderPane. I don't want to allow components to move. I want to shrink them and use Scrollpane` when their size is reduced. Can you give me some hits how to solve these two problems?
    Ref javafx 2 - Set location of components and reduce the size - Stack Overflow

    I did something similar the other day. Based on the resizing of the scene I adjusted the position.
    widthProperty().addListener(new ChangeListener<Number>() {
        @Override public void changed(ObservableValue<? extends Number> observableValue, Number oldSceneWidth, Number newSceneWidth) {
            widthChange((Double)oldSceneWidth, (Double)newSceneWidth);
    heightProperty().addListener(new ChangeListener<Number>() {
        @Override public void changed(ObservableValue<? extends Number> observableValue, Number oldSceneHeight, Number newSceneHeight) {
            heightChange((Double)oldSceneHeight, (Double)newSceneHeight);
    You should be able to do something similar, when you add a change listener to your component and handle the resizing of the other components.
    What I don't understand is why you would need a scrollbar, when the components shrink down. I would think it would be the other way round.

  • How do you set location based reminders with location restrictions turned on?

    I can set location based reminders with location restrictions turned off, but I want them on. Otherwise if I lost or if somebody stole my iPhone they could just turn off the find my iPhone function. Yet if I have location services restricted to prevent this then location based reminders are unavailable. Any help would be appreciated

    I can set location based reminders with location restrictions turned off, but I want them on. Otherwise if I lost or if somebody stole my iPhone they could just turn off the find my iPhone function. Yet if I have location services restricted to prevent this then location based reminders are unavailable. Any help would be appreciated

  • Logic plug in setting locations?

    Hi, I'm still kind of new to Mac's and a few weeks ago I was cleaning up and re-orginizing some of my folders. I wasn't aware that mac's are much, more folder specific than a windows OS?  While moving various files/folders when cleaning/orginaizing, I must have moved some of my 3rd party logic folders?  I didn't move any of the actual au componnets they are still in the correct place so that logic can locate them.  Only problem now they can't seem to locate them even though the components show in the correct component folder?  Did I mess something up by moving folders around?  I had assumed as long as I didn't mess with things like the actual component and preset folders that it didn't really matter if I moved I guess what you would call the plugins' main root folder, if that sounds right? 
    Appart from probably having to trash everything and re-install is there anything I can do?  Perhaps a quick fix like ,"just drag/move all my 3rd party plug ins to such and such folder?  I don't understand why in a mac that you can't just create a new folder and  call it, "logic plug in related files"  for example;  and move all of your 3rd party plug ins over to it(except for the actual commponents of course)?  Or can you?  I guess I'm just generaly copnfused about plug in setting locations for both 3rd party and non.  Am I correct in saying that plug in setting location folders can actualy vary from 3rd party to 3rd party plug ins? If this is true what a pain! Like I said I probably have no other option except to delete and re-install?  I wish my mac could be brought back to how it was before I messed with any folders!  Trouble is to free up hard drive space I got rid of a bunch of time machine backup so I don't think I can go back to a previous state before I moved any stuff around:(
    I just don't get it though and its very annoying.  For example, I have a lexicon reverb bundle, always worked great;the correct components are still in the correct audio/plug in/commponent folder, but ever since I moved some root plug in files around the lexicon plug ins no longer show up.   They don't even show in the AU manager,which is frustrating becasue I can go to the component folder and they are physicaly there!  Why would it not even show in the AU manager if the component is physicaly in the right place still?Help please...Wha did I do/What do I do?
    Thanks everybpody,
    Mike

    A line across a plugin usually comes from trying to insert a mono plugin on a stereo track of vice versa. Could this be your problem.
    I've rearranged my project folders many times without any problem whatsoever. Have you saved your projects with Assets?
    R

  • How set location for tooltip text ??

    hi ,
    i want to set tooltip location myself to a button . for this i override methods are
    1. public String getToolTipText(MouseEvent e)2 public Point getToolTipLocation(MouseEvent e)here is code... where i have to change to set location for tooltip
    * DebugGraphicsTest.java
    * Created on April 28, 2005, 1:14 AM
    package swingtest;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    * @author  Paramasivam
    public class DebugGraphicsTest extends javax.swing.JFrame {
        public DebugGraphicsTest() {
            initComponents();
            MyButton  btn = new MyButton("Chem m e");
            btn.setToolTipText("this is actual");
            getContentPane().add(btn);
            jButton1.setToolTipText("button 1");
            jButton2.setToolTipText("button 2");
            jButton3.setToolTipText("button 3");
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        private void initComponents() {
            jPanel1 = new javax.swing.JPanel();
            jButton1 = new javax.swing.JButton();
            jButton2 = new javax.swing.JButton();
            jButton3 = new javax.swing.JButton();
            getContentPane().setLayout(new java.awt.FlowLayout());
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            jButton1.setText("jButton1");
            jPanel1.add(jButton1);
            jButton2.setText("jButton2");
            jPanel1.add(jButton2);
            jButton3.setText("jButton3");
            jPanel1.add(jButton3);
            getContentPane().add(jPanel1);
            pack();
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new DebugGraphicsTest().setVisible(true);
        // Variables declaration - do not modify
        private javax.swing.JButton jButton1;
        private javax.swing.JButton jButton2;
        private javax.swing.JButton jButton3;
        private javax.swing.JPanel jPanel1;
        // End of variables declaration
    class MyButton  extends JButton{
        public MyButton(String s){
            super(s);
        public Point getToolTipLocation(MouseEvent evnt){
            return new Point(100,300);
        public String getToolTipText(){
            return "hihi";
        public String getToolTipText(MouseEvent me){
            return "event hihi";
    }

    Adding the line ToolTipManager.sharedInstance().registerComponent(this); to MyButton's constructor seems to solve the problem.

  • Set location in runtime..

    Hi
    usually i used to save file like this
    String retreive = textarea.getText();
              RandomAccessFile logfile = new RandomAccessFile("c:\\saved.txt","rw");
              logfile.writeBytes(retreive);
              JOptionPane.showMessageDialog(null,"Saved ..","Saved...",JOptionPane.WARNING_MESSAGE);
              catch(IOException e)
              System.out.println("cannot write on to log file....");
              }But it works correctly , i set location inside that and it will save file as i set the location..
    How can i save and decide where to save the file at runtime...
    i mean when i press save button i want to select the drives and save it to the folder as i wish...
    is there any suitable solution.???

    Use a JFileDialog to get the location from the user and use that instead of hardcoding c:\\saved.txt.

  • Unable2download any content,site requests security questions.hav not set any up

    unable2download any content,site requests security questions.hav not set any up&amp;unable2proceed with purchases.
    please provide response asap.

    If this was purchased many months ago it may be because Apple changed its security set-up about six months ago at a rough guess. Go to and complete the questions posed at:
    iforgot.apple.com
    this leads you to https://iforgot.apple.com/iForgot/iForgot.html
    as I could not make the link work in draft mode of writing this response.

Maybe you are looking for