OPINION WANTED: Why can't Sun make the setBounds more meaningful?

Hi,
I am wondering why Sun doesn't add some brains to the setBounds method. I bring this up because of my current situation.
I have two panels, A & B. A is added to B, and A can be dragged around "on top" of B. But I can not allow the user to drag A out of the bounds of B. so I have to do all this checking to make sure it doesn't happen. It would be much simpler if the A panel could know what the size of its "playground" is.
Doing something like this would be nice,
A.setPlayground(B.getBounds());then as A is dragged around, it knows what its "playground" is and knows that its own bounds cannot not leave the "playground". But currently, there is no such implementation, so I would basically have to create my own JPanel class, and include this functionality...which I wish Sun would implement.
Anyone else think this is a good idea or worth while to do? Whats your opinion?
Thanks.

Ok, that is basically doing the same as rect.contains(rect) .....and instead of creating new rectangles i could just do this:
if (rectangleA.contains(panelB.getBounds())) ...However, a problem still occurs that a user could drag the panel quickly, and its location gets set so that it is no longer "contained" in rectangleA.
if rectangleA's bounds are [0, 0, 200, 200] the panelB's bounds could get set so that its bounds are [200,y,w,h] ....so u can see the x value is at the max of rectangleA's bounds....so when i try to do rectangleA.contains(panelB.getBounds()) it fails....so to fix this I have to do this:
if ((panelB.getMinX() < 0) ||
                                       (panelB.getMinY() < 0) ||
                                             (panelB.getMaxX() > rectangleA.getMaxX()) ||
                                             (panelB.getMaxY() > rectangleA.getMaxY())) {
                                  temp.setLocation(oldLocation);
                             }i wish i didnt have to do all that checking like that.

Similar Messages

  • HT201263 My iPad 1 can only be updated to iOS 5 yet most apps run on iOS 7. Why can't I make the update on my iPad 1? Is this so I buy another iPad 2+? Now why would I want to buy something that will be obsolete in a few years?

    My iPad 1 can only be updated to iOS 5 yet most apps run on iOS 7. Why can't I make the update on my iPad 1? Is this so I buy another iPad 2+? Now why would I want to buy something that will be obsolete in a few years?  I really want to purchase an Live TV plan yet I need iOS 7 to run most TV apps.
    Can Apple tell me why my iPad 1 is obsolete?
    g

    It's not obsolete as much as the first gen simply lacks the power to run the newer operating systems. IT doesn't have enough RAM. If someone managed to hack it to get iOS 6 or 7 on there they'd just have a slow, boggy and unresponsive device. (think putting windows 7 on an old laptop.
    Unfortunately software moves faster than hardware. Every thing goes obsolete. I've had my ipad 2 for two and a half years now and I know it only has so much longer left to it too. Just the 'joys' of advancing technology.

  • Why do i constantly get cut off on calls.  I've had this problem with my 3GS, my 4S and now my iPhone 5.  When the core functionality is Phone, i.e. the ability to talk, why can't Apple make the iPhone function as a Phone?  is there an App for that !!

    why do i constantly get cut off on calls.  I've had this problem with my 3GS, my 4S and now my iPhone 5.  When the core functionality is Phone, i.e. the ability to talk, why can't Apple make the iPhone function as a Phone?  is there an App for that !!

    Well, since you've had the same problem, with three different phones, that all use different size sim cards, it seems pretty obvious the problem is with your carrier/coverage & nothing to do with your phone or sim card.

  • Why can't I make the applet work?

    I have developed an applet to capture the video stream from a Logitech (usb) camera and display it in the applet. This is a clone of another program that captures a network camera video stream and does the same thing.
    I am using JBuilder 2005 and when I run the applet in the JBuilder applet viewer, it works fine, but not when I attempt to run it in the browser.
    In the network camera application, I was able to overcome this by signing the jar file and it would run in the browser.
    In the Logitech application signing the jar file does not work. I get the mesage that asks me if I want to accept the certificate, but it still does not initialize the camera.
    Since I can use it in the Applet Viewer, I have to assume that all the connections are set up OK.
    But the application fails when trying to get the capture device in:
    di = CaptureDeviceManager.getDevice(str2);
    I put the startup code in a thread and perform several iterations with a slight delay, suspecting that there may be a timing issue, but that was not the problem.
    This code also works in a stand-alone application version.
    The only thing I can think of is that there is some other connection or security issue that I am not addressing.
    Since signing the jar file works with network video streams, I have to think that there is something different between USB and network video streams, but I have no clue as to what it might be.
    Anyone have any suggestions?

    from the JMF readme file
    Security Note
    During the installation, you will be asked two security related questions:
    * Permit recording from an applet
    If you agree to this, JMF will allow applets to capture audio and video from the local capture devices. It is possible for a malicious hidden applet on a web page to quietly record sounds or video from your system and transmit the data back to a system on the internet. This is usually a risk only if you visit unfamiliar web sites.
    You can disable or enable this feature by running the JMFRegistry application (or choose Preferences from the JMStudio File menu), modify the setting in the User Settings tab and commit the changes.
    * Permit writing local files from an applet
    This is a greater security risk since a malicious applet can overwrite files on your hard disk without your knowledge. Enable this feature only if you need it for a specific application and are sure that you will not visit any possibly malicious web sites.
    You can disable or enable this feature by running the JMFRegistry application (or choose Preferences from the JMStudio File menu), modify the setting in the User Settings tab and commit the changes.

  • Why can't I access the "See more..." section of people's long posts on Facebook? I used to on Firefox and I still can on Safari but no more on Firefox..

    When people write a long status update on Facebook, the site shows the first few sentences and then adds a blue hot link. The link says "See more..." and mouse clicking this allows you to see the complete status. It saves space on Facebook.
    I always accessed this feature on Firefox but since the last update it isn't working. I went to Safari and the blue linking text functions perfectly. Only on Firefox is it disabled. Clicking the link does nothing.
    I checked preferences in Firefox but could find nothing that would cause this to happen.
    Please tell me how to make the link functional again.

    Many site issues can be caused by corrupt cookies or cache. In order to try to fix these problems, the first step is to clear both cookies and the cache.
    Note: ''This will temporarily log you out of all sites you're logged in to.''
    To clear cache and cookies do the following:
    #Go to Firefox > History > Clear recent history or (if no Firefox button is shown) go to Tools > Clear recent history.
    #Under "Time range to clear", select "Everything".
    #Now, click the arrow next to Details to toggle the Details list active.
    #From the details list, check ''Cache'' and ''Cookies'' and uncheck everything else.
    #Now click the ''Clear now'' button.
    Further information can be found in the [[Clear your cache, history and other personal information in Firefox]] article.
    Also try the following if the above did not solve your issue;
    '''Try the Firefox Safe Mode''' to see how it works there. The Safe Mode is a troubleshooting mode, which disables most add-ons.''
    ''(If you're not using it, switch to the Default theme.)''
    * You can open the Firefox 4.0+ Safe Mode by holding the '''Shift''' key when you use the Firefox desktop or Start menu shortcut.
    * Or use the Help menu item and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    ''Don't select anything right now, just use "'Start in Safe Mode"''
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before using the Firefox shortcut (without the Shift key) to open it again.''
    '''''If it is good in the Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one.
    Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''When you figure out what's causing your issues, please let us know. It might help other users who have the same problem.''

  • TS1702 why can't i update the app more than 50mb from itune but can throught wifi?

    I tried to update Apps more than 50mb through itune, but found the Apps which are needed to be update are mark "Downloaded" in iTune store.  Of course if the Apps mark "Downloaded" are not able to do anything with it.  On the other hand, I can simply use wifi to update the Apps, more than 50mb, throught my iphone instead of iTune.  Is there any problem with iTune or something wrong with my phone?

    In the App section of your itunes library ( NOT the sync pages) there is a button at the bottom which says Check for updates

  • Why can't you make the bookmark toolbar visible by default?????

    I went to organize my bookmarks and there is no toolbar. Now, you say it is hidden by default. That's crazy. Anyway, I can't follow the instructions. There is no Firefox button to click. There is no "options" option anywhere.
    I can't even set my default options for applications, or the Internet. That's gone too. Will you please ;make these helpful tools VISABLE BY DEFAULT! If not, why not?

    Thank you very much, Car-el. If others had told me this, the problem would have been solved three days ago! However, I wanted to rename a folder, and I don't see that this is possible. I would think that after one goes to the "Show All Bookmarks" one could change the name in the "folder name" text box and it would work, or right click on the actual folder one wants to rename and the pull down would have that option. Not so for either here. So, my problem is still not solved. Oh, well.

  • Why Can't I Make Calls Any More?

    HI,
    I renewed my subscription last week but when I now go to make a call, it asks if I want to pay as you go or get another subscription.  My account says that I have 400 minutes left.
    Can someone please advise what I need to do to be able to make calls from my subscription again?
    Thanks
    Stuart

    Hi Stuart,
    Your subscription is active and it should show on your account https://secure.skype.com/account/
    I didn't find any call attempts on your account, could you please:
    * Make sure you have latest Skype from: http://www.skype.com/go/downloading
    * Log in with the exact same account
    * Place a free test call first to Skype users
    If after that you are still not able to make calls to covered destinations then please contact customer service: https://support.skype.com/en/faq/FA1170/How-can-I-contact-Skype-Customer-Service
    Andre
    If answer was helpful please mark it with Kudos and if issue is resolved mark it with solution. This will help other users find this answer more easily. Thanks in advance!

  • I have upgrade ios 6 to ios7 on my iphone 5.  I do NOT like it.  I want to come back to the previosu version.  why is it so complicated.  Why can I not find the instruction strait from apple? This is the worst possible upgrade ever.

    I have upgrade ios 6 to ios7 on my iphone 5.  I do NOT like it at all.   I want to come back to the previous version.  why is it so complicated? Why can I not find the instruction strait from apple? This is the worst possible upgrade ever.  It make me think of when ericsson got sold to Sony....drastic PC change.
    I would like to have simple instruction on how to downgrade.
    It feel like a change that I did not ask for , ok I push the upgrade buttom, but really this is the worst update aver!
    HELP!

    iPhone User Guide (For iOS 7 Software)Sep 20, 2013 - 23 MB

  • Why can't I make a playlist from the vdownload app since installing Iso7

    Why can't I make a playlist from the vdownload app since installing iso7

    So where do you do when apps just seem to stop working, particularly when you paid for an app.  I have now had then happen twice and there seems to be very little customer care from Apple when this occurs.  Just a note to let customers know that an app will no longer work or who to contact would be great. Thanks, Kevin

  • Why can't I make a purchase from my new IPod using a new credit card which is different from the one registered with my apple account ?

    Why can't I make a purchase from my new IPod using a new credit card which is different from the one I have registered with iTunes before ?

    You can only use one credit card to one Apple ID.

  • Why can't I make any calls on facetime, the call drops after saying connecting.

    Why can't I make any calls on facetime, the call drops after saying connecting for a few seconds. I'm using an iphone 5, 32 GB on IOS 6.0.1 over 3G network in Muscat, Oman. Just to be clear, I was able to make facetime call in Muscat about a week ago.

    If this user to user forum could not help you with your issue, contact Apple to get your Device serviced or looked at.
    http://www.apple.com/contact/

  • How do I change the default programme to open pictures when downloading? Why can't I make it automatic? - the tick box is greyed out.ut

    How do I change the default programme to open pictures when downloading? It always proposes Windows Live Photo Gallery and I have to change it to Windows Photo Viewer every time. Why can't I make it automatic? - the tick box is greyed out.

    Thread discussing this issue here:
    http://discussions.apple.com/thread.jspa?messageID=1289317

  • HT1918 The cc on my acct doesn't have the $ to buy an app that I want but my account has $50.00 credit. Why can't I purchase the app with gift card?

    The cc on my acct doesn't have the $ to buy an app that I want but my account has $50.00 credit. Why can't I purchase the app with gift card?

    It says there is a problem with my payment information and prompts me to change payment info but I am only able to change it to another type of cc not gift card balance

  • Why can't I make a call? Bills paid

    Why can't i make a call?  All morning my phone worked and now when I try to call even you I get told I am being sent to an outside operator where I can pay to make a call with my credit card.  I also pay for this service!!!!  Why can't I make a simple call are your towers down? I am in Klamath falls or.

        Charise820,
    We are dedicated to offering you the best possible service where you need it most, It does concern us to hear that the service has not be the best lately but will work to get this resolved as soon as possible. I can see that this happened yesterday but I do want to check to see if your service has been restored? Are you not able to access the internet or send and receive text messages? Please keep us posted.
    CandiceH_VZW
    Follow us on Twitter at @VZWSupport

Maybe you are looking for

  • IPod Nano crashes with BMW adapter after 1.3 update

    Hi All, I have a 1st Gen 4G iPod Nano that I have updated to the new firmware version 1.3. The problem is that now when I connect the iPod to the BMW adaptor kit in my car the iPod freezes after approximately 1 hour and will not change play lists or

  • Need to synch calendar and contacts, but also open attachments with OWA

    I have a client with a Tour 9630.  They are using Exchange 2007 so we cannot use BES or BPS on that server (their only one). His biggest gripe using the redirector was that he could not open attachments.  After doing some digging, I found out that yo

  • Before insert Trigger and SQL Loader

    Hi, I have a table with a BEFOR insert on each row trigger . I am loading the data to that table using sqlloader and I want my trigger to fire for each row. But the trigger is firing only for alternate rows. body of trigger as follows. select max(pd_

  • Call ITS from BSP Application

    i have created a ITS screen which in turn calls a Abap report I want to call this ITS screen from a BSP application . Could you please provide some sample code which is used to call ITS from BSP application.. Useful answers will be rewarded Thanks

  • Pc Card Problem

    Purchased a Novatel u730 PCcard Have downloaded the demo version software from nova. Still does not work. need Help