Drag and Drop Shapes that snap back to its original position, if it is placed in the correct shape it stays there. What code can I use? PLEASE HELP!

I need the code for this, how could I possible do this?
I'm a begginer and I am very interested as to how I can create this.

using the same initialization code shown in your previous post, use:
// in your drop listener function
if(square.hitTestObject(whatever)){
square.x=whatever.x;
square.y=whatever.y;
} else {
square.x=square.initX;
square.y=square.initY;

Similar Messages

  • I have a photo that is to dark. I can lighten it up in FL and PS, however it goes back to its origin

    I have a photo that is to dark. I can lighten it up in FL and PS, however it goes back to its original dark state when placed on a new PS page. How do I lightenthe photo and keep it that way?
    Thank you.
    Tim

    Trust me when I say this coming from 20 years of experience.
    Get a powered external drive, format it 1 Partition Option: GUID and OS X Extended Journed as the format in Disk Utility.
    Download and install Carbon Copy Cloner, clone internal drive to external drive.
    Set a schedule to remind you to do it at least once a week, keep it near your charger.
    When you plug your charger in, do plug the clone and power the machine up, set the display to sleep only,
    CCC will do the rest.
    If you want to boot from it, hold the option/alt and select it Startup Manager.
    I've seen many TimeMachine and TimeCapsule nightmares and so far haven't seen a problem from anyone using a bootable clone.
    It's simple, it's easy, it's more reliable and more powerful than what Apple does and it only takes plugging in a extra cable.
    Make as many clones as you want, keep them time seperated, off site etc. etc.
    Cables don't have network issues, clones can be verified in seconds merely by booting from them.
    Clones protect your productivity, your up in seconds on a clone despite even the hard drive dying.
    Software problem? No sweat, boot of the clone and reverse clone your problems away.
    If you want to fuss and muss with half implemented TimeMachine and TimeCapsule network headaches then prepare to suffer.
    I don't like to suffer, I bought a Mac not to suffer, but it appears you do with TimeMachine and TimeCapsule.
    Most commonly used backup methods

  • I moved my iphoto folder to a new location by mistake. I've moved it back to its original location, but iphoto no longer sees the photos. What step(s) am I missing to return to the setup I had.

    i moved the folder containing all of my photos to a new location on my hard drive by mistake. I've moved it back to its original location, but iphoto no longer sees the photos. What step(s) am I missing to allow iphoto to see the photos as it did before. Also,
    I am trying to back up all of my photos to a thumb drive. Is there a way to do this thru iphoto?

    Witholut knowing what you did, it's hard to know what you missed doing, no?
    Try Hold down the option (or alt) key key and launch iPhoto. From the resulting menu select 'Choose Library'
    Backing up just the Photos? File ->Export
    Backing up the Library? 
    Most Simple Back Up
    Drag the iPhoto Library from your Pictures Folder to another Disk. This will make a copy on that disk.
    Slightly more complex:
    Use an app that will do incremental back ups. This is a very good way to work. The first time you run the back up the app will make a complete copy of the Library. Thereafter it will update the back up with the changes you have made. That makes subsequent back ups much faster. Many of these apps also have scheduling capabilities: So set it up and it will do the back up automatically. Examples of such apps: Chronosync or DejaVu . But are many others. Search on MacUpdate

  • When my Ramp stops the set pops back to its original position...?

    I have a set to which I have attached a Ramp behaviour to swivel it on it's Y axis.
    Its works well, but at the 10 second point when the Ramp Y swivel ends, the set jumps suddenly back to its original position.
    How can I get the set to keep its position as it is at the end of the Ramp behaviour?
    ps: Merry Christmas to all on the forum, and thanks for your help during 2008!

    Or you can use the Spin behavior. The object will stay where it is after the spin is finished.
    Andy

  • I upload my iPhone 4s and it went to recovery mode i have tried to exit recovery mode by pressing the home  and the power bottom but it doesn't work what more can i do please help me

    i upload my iPhone 4s and it went to recovery mode i have tried to exit recovery mode by pressing the home  and the power bottom but it doesn't work what more can i do please help me

    http://support.apple.com/kb/ht1808

  • I have a Mac OS X Snow Leopard version and my fan keeps coming on. I have been away for a week so it has not been used and yet when I started it up the fan started straight away. Is there anything I can do? Please help! Thanks

    I have a Mac OS X Snow Leopard version and my fan keeps coming on. I have been away for a week so it has not been used and yet when I started it up the fan started straight away. Is there anything I can do? Please help! Thanks

    Yes, look in Activity Monitor (Applications /Utilities /Activity Monitor.app) and see what it eating up all the %CPU. If anything is over 40%, post the name here to get advice or just kill it straight away with the red 'Quit' button.
    If nothing is using up CPU resources, but the fans are going full blast, do an SMC reset. Read the instructions here:
    http://support.apple.com/kb/HT3964

  • I can't drag and drop files that are already on my desktop

    Files and images that are already on my desktop will not respond when I try to 'drag and drop' them, for example into the trash or iPhoto.
    No idea how this has happened!
    Thanks

    Probably but I don't know why.  If everything's working don't worry about it, change it to what you want and count your blessings - there's nothing wrong with your Mac!!!

  • Within Music Library can anyone please explain why when I select the option to sort 'Album by Artist' a number of tracks are being treated as separate albums?  How can I correct this?  I have tried to 'drag and drop' but that doesn't work.

    Within music Library can anyone please explain why after I select the option to sort 'Album by Artist' a number of tracks are being treated as separate albums?  How can I fix this?  I have tried to manually correct by 'drag and drop' individual tracks but that doesn't work.  My music library includes a number of repeat album artwork images simply because not all tracks are being listed under the one album making my library more difficult to use than it should.  Any advise would be appreciated.

    See Grouping tracks into albums.
    tt2

  • JInternalFrames  that snap back to their original size and bounce around

    1. How do I make the JInternalFrames not snap back to their original size after I resize them (drag with mouse)?
    2. How do I bet the internal frames(minimized or open) to not bounce around when I add a new one?
    Thanks!!
    here is the code:
    //DM.java
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    public class DM extends JFrame{
    Container contentPane;
    JDesktopPane deskTop;
    int queryCount = 0;
    /////////////////// CONSTRUCTORS ////////////////////
    public DM(){
    super("Data Miner 0.1, Triad Therapeutics, Inc.");
         contentPane = getContentPane();
         deskTop = new JDesktopPane();
    deskTop.setBackground(new Color(0,0,150));
    deskTop.setLayout(new FlowLayout());
    contentPane.add(deskTop, BorderLayout.CENTER);
    ////// MENU BAR ////
              JMenuBar menuBar = new JMenuBar();
    //// Query Menu
         JMenu queryMenu = new JMenu("Query");
         JMenuItem targetQueryItem = new JMenuItem("Target");
    queryMenu.add(targetQueryItem);
    ////// MENU BAR ASSEMBLY ////
    menuBar.add(queryMenu);
    setJMenuBar(menuBar);
    ////// MENU BAR ACTION LISTENERS ////
    targetQueryItem.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e){
    JInternalFrame qc = new JInternalFrame("TEST2",true,true,true,true);
    qc.setPreferredSize(new Dimension(500, 300));
              qc.setNormalBounds(new Rectangle(300,300));
    //qc.setBounds(10, 50, 300, 500);
    //qc.setVisible(true);
    qc.show();
    deskTop.add(qc);
    }// end DM constructor
    ////////////////// MAIN METHOD /////////////////////////
    public static void main(String[] args){
         DM dm = new DM();
                   dm.setBounds(10,100,1000,450);
                   dm.setVisible(true);
                   dm.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
                   dm.addWindowListener(new WindowAdapter() {
                        public void windowClosed(WindowEvent e) {
                                  System.exit(0);
    }//end main
    }// end DM class

    Use the direct select tool to select the image, then set the scale in the scale fields to 100%, and finally, fit frame to content.

  • How do I drag and drop files in iTunes 12?  I don't see my other computers in the side bar only playlist?

    I upgraded to Itunes 12 and now cannot drag and drop my movies & music files between my shared computers?  The side bar option, which only appears under the Playlist tab does not show my other shared devices where I used to simply drag files over and drop them on them to transfer.  I have 2 IMACs and a macbook pro that i like to keep hard copies of my music and video libraries on.  Anyone know how I can get my shared computer to show up on the side bar so I can drag and drop like I've been doing for the last 5 years?

    Thank you Peter.  Mine is more about creating playlist on my iMac and then wanting to drop it it on to my macbook pro for tailgating and family events, instead of recreating.  That doesn't seem like something that should bother apple as I already have the music and I am not going to go purchase it again off iTunes if this is what they are thinking.  I think this is about limiting our ability to share music and movies.   

  • Drag and drop an image over a JPanel (only change position on same JPanel)

    Hi all,
    there is JPanel added to a JDialog.
    There is a BufferedImage on the JPanel: I need to let the image be dragged and dropped in another position over the same JPanel and read the new position's coordinates.
    (Maybe the image has to be wrapped in a JComponent?)
    Thanks in advance for any suggestions.
    Ludovico

    (Maybe the image has to be wrapped in a JComponent?)Just add the image to a JLabel and add the label to the panel.

  • I dropped my ipod touch gen 5. and the screen went a very dark blue. and the screen is not responding. all you can do i turn ond off the home button. but the screen still doesnt show up. what do i do? please help

    hi
    not even 20 minutes ago i accidentally dropped my iPod touch generation 5. and the screen wasn't responding. it went dark blue/ black color. when you press the on/off button or the home button, all that happens is that the screen light up but not eh background,time and etc. its just a simple black screen with a glow. my iPod has already being cracked before. and i haven't fixed it.
    please tell me what i can do. should i reset it or what? my iPod is honestly my life. i backed it up and everything yesterday. im so glad i did that. please help

    Try
    - Restore from backup. See:                                               
    iOS: Back up and restore your iOS device with iCloud or iTunes
    - Restore to factory settings/new iOS device.                       
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
      Apple Retail Store - Genius Bar                              
    Unless you purchased the option AppleCare+ extended warranty
    Apple will exchange your iPod for a refurbished one for $99 for 16 GB 5G and $149 for the other 5Gs. They do not fix yours.
    Apple - iPod Repair price                                    
    A third-party place like the following may be able to fix it for less less. Google for more.
    iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens         
    Fix it yourself if you are up to it. However, it is hard since yo do not know what is wrong
    iPod Touch Repair – iFixit                  

  • Macbook drag and drop different that magic trackpad ?

    Dear friends,
    I have been using a Magic Trackpad with my 27" iMac  for a long time and have it configured so that a slight single finger tap then enables the dragging of the current window or selection.
    On my new rMBP I can achieve this only by clicking and keeping pressed and dragging (tiresome if I have to move long distances) or configure the three-finger drag I'm not used to.
    Is there anyway to have the rMBP (10.8.2) behave like the Magic Trackpad ?
    TIA

    I don't usually use tap to click (hate it, personally), but turning it on, I can't find a way to drag a file using just taps and drags.
    However, one thing that took me a while to figure out with the MBP is that you don't have to use the same finger you're dragging with to do the clicking. Despite the fact that the MBP's trackpad is multi-touch sensitive, and ordinarily using multiple fingers triggers a gesture of some kind, it seems to be smart enough that you can click with your thumb (as if there were a separate button) while dragging with your index finger, and this won't trigger a "pinch" gesture.
    Dunno if that will help you or not.

  • I've put together a slide show and cannot get it on You tube.  I've put the presentation together in Iphoto, then sent it to ITune and I cannot get Youtube to accept it.  On the upload page, Youtube even says just drag and drop. That didn't work.  Help!

    To repeat my problem, I've put together a slide presentation and am trying to get it on Youtube...have compiled photos and music under IPhoto, then moved it to ITunes to dump into YouTube, but can't get anything to go thru.  Have submitted two previous slideshows and don't remember ever having this probem.  Am sure I'm doing something wrong.  Anyone have suggestion(s) as to how to get this on to Youtube.  Have been stonewalled for the last two hours.  Thank You.

    Sanjam....you are having the identical problem I'm having.  Re the response to your dilemma, I'm gonna see if there is a way to export.  If I figure something out to get on YouTube will let you know and would appreiate you doing the same.

  • TS3274 I recently lost all my notes and my ipad will no longer allow me to connect to my yahoo email via the Mail app. Is there anything i can do?

    I also think it may have to do with the fact that i dropped it...
    When i try to connect to my yahoo email via the Mail thingy, it will say "user name or password for apple.imap.mail.yahoo.com is incorrect even though my yahoo password and user name is correct. I know because if i were to het my username or password wrong, it would tell me "user name or password for *insert my email* is incorrect".

    Charsiew wrote:
    I also think it may have to do with the fact that i dropped it...
    When i try to connect to my yahoo email via the Mail thingy, it will say "user name or password for apple.imap.mail.yahoo.com is incorrect even though my yahoo password and user name is correct.
    This is copied from your first post. Am I reading this wrong? Aren't you saying that you are getting a message that the username and password are incorrect? That's why I asked another the word apple in the name. I don't use Yahoo mail that may in fact be correct but I'm just checking,
    IF you are getting a message that the username and password are incorrect.....
    Check the outgoing mail server setting. Make sure that your username and password are in there.
    Settings>Mail, Contacts, Calendars>Your email account>Account>Outgoing mail server - tap the server name next to SMTP and check in the primary server and make sure your username and password are entered and correct - even if it says that the password is optional.

Maybe you are looking for

  • Framework Profile

    Hi Experts,           I have copied BuPaMoreContactView.htm view of CRM_IC BSP application into Z_CRM_IC appln. In Framework Profile setting, i have maintained the replacement Z_CRM_IC for CRM_IC. Also created one IC Webclient profile for the by copy

  • HT201317 Will photos deleted from camera roll be deleted in photo stream?

    There is so many contradicting answers online! I just want to take more photos and keep the ones I have. So, if I delete my camera roll, with the photo stream "backed-up" w/ iCloud, will the photos in photo stream be untouched?

  • Restart computers via GPO

    Hello all, I would like to do restart all our lab computers (joined into domain) daily at 23:59. Is there anyway I can schedule the script via GPO ? My domain controller in on windows 2003 ent server. Throw your ideas or point me in right direction h

  • Pages don't open--site hangups?

    I am using 10.4.6 on a mac-mini, Safari, and my internet connecton is dial-up through Draytek external modem (my only choice). I have noticed for some time that after I have been on the net for awhile, and visited 5-10 sites, the pages will begin to

  • HT5557 How do I permanently delete books from iCloud?

    Trying to delete books from iBooks/iCloud.  Help.