Can't dispose my dialog after moving it using swing timer.

Hi all,
I use the swing timer to move a dialog from one position to another. Here is the code I have use.
// Set the main window display location
    public void setWindowLocation()
        int screenHeight = Toolkit.getDefaultToolkit().getScreenSize().height;
        int screenWidth = Toolkit.getDefaultToolkit().getScreenSize().width;
        int frameHeight = this.getHeight();
        int frameWidth = this.getWidth();
        int _xValue = (screenWidth - frameWidth);
        int _yValue = (screenHeight - getTrayheight() );
        int _yEnd = (screenHeight - frameHeight - getTrayheight() );
        //this.setLocation((screenWidth - frameWidth), (screenHeight - frameHeight - getTrayheight() - WINDOW_SPACE));
        this.setLocation(_xValue, _yValue);
        while(_yValue > _yEnd){
            dialogMotion(this, _xValue, _yValue);
            _yValue -= 1;
        // this.dispose();
// Dialog motion
    private void dialogMotion(final MainDialog mainDialog, final int x, final int y){
        AbstractAction abAction = new AbstractAction() {
            public void actionPerformed(ActionEvent evnt) {
                mainDialog.setLocation(x, y);
        Timer motionTimer = new Timer(300, abAction);
        motionTimer.setRepeats(false);
        motionTimer.start();
// Find the taskbar height to place the main frame in lower-right corner
// of the viewable area of the screen.
    private static int getTrayheight(){
        return (Toolkit.getDefaultToolkit().getScreenSize().height -
                 GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().height);
    }I think my code is clear to you. After moving the dialog onto the task bar, I want to dispose it. You can see that at the end of the while loop I've try it.
What happened there is, I can't see the dialog moving. it directly dispose. I add a breakpoint at the while loop and check, it iterate until condition is false. But I can't see the motion. If I comment the dispose code line as in my above code, I can see it moving.
Why is that. Your comment really helpful to me.
I'm worried is that debugging iterate that while loop but it is not visible. :( :(

Thanks a lot. I got the point all of you said. But it is bit confusing how to do it.
As i said in my first post, used slightly similar code to move down the dialog. Here what I have try. But the question is because of my thread used there, it wait little amount to scroll down.
    private void hideWindow(MainDialog mainGialog){
        try{
            int _xAbove = mainGialog.getLocation().x;
            int _yAbove = mainGialog.getLocation().y;
            int _yBelow = mainGialog.getLocation().y + mainGialog.getHeight() + getTrayheight();
            while(_yBelow > _yAbove){
                dialogScrollingUpDown(this, _xAbove, _yAbove);
                _yAbove += 1;
            Thread.sleep(1000);
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    try {
                        Thread.sleep(1500);
                        dispose();
                    catch (InterruptedException e) {
                        e.printStackTrace();
        catch (Exception ex) {
            System.out.println(ex.getMessage());
    private void dialogScrollingUpDown(final MainDialog mainDialog, final int x, final int y){
        AbstractAction abAction = new AbstractAction() {
            public void actionPerformed(ActionEvent evnt) {
                mainDialog.setLocation(x, y);
        Timer motionTimer = new Timer(400, abAction);
        motionTimer.setRepeats(false);
        motionTimer.start();
// System tray height
    private static int getTrayheight(){
        return (Toolkit.getDefaultToolkit().getScreenSize().height -
                 GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().height);
    }Actually I called the hideWindow method in a button clicked event. After clicked the button, it wait a time equal to the first thread sleep. I can't reduce the time, if so dialog dispose instant.
Whay I can't do all those things is my IDE not allowed to use frequently changing values in dialogScrollingUpDown method. You can see that in my code.
Any comments for that.

Similar Messages

  • Can't open Numbers file after moving it back to Mac from Dropbox

    Please help!  Can't open Numbers file after moving it back to iMac from Dropbox.   Says I need the newer version of Numbers each time I tried to open the file.  I am 100% sure that I had the newest version.   Spoke to the AppleCare guy and after doing the checks he is also sure that I had the latest version of Numbers and AppleCare can't help.  He suggested that maybe i should run it on a file repair program...any suggestion?... please help...

    I've read reports of people having trouble when storing Numbers 3 documents on Dropbox.  I think it's related to the fact that they're not really "files."  They're "packages" that look like files. I had thought that Dropbox had cleared this up with their latest update. You should be on Dropbox version 2.4 or later.
    If you have Time Machine you may have some luck going back in time and restoring the document from a previous version.
    Storing Numbers documents on iCloud works much better, at least for me, and (unlike Dropbox) iCloud facilitates automatic syncing to other Macs and iOS devices signed into the same Apple ID.
    Perhaps you could consider keeping Numbers documents in iCloud instead. iCloud is deeply integrated into the app, and now works well.
    SG

  • How can I set up a wi-fi network, using one time capsule and two airport express

    how can I set up a wi-fi network, using one time capsule and two airport express ?
    The time capsule is near the Mac. ok
    The first Airport is on the corridor, ok, works well and the App on the iPad signals so, ok
    But when I plug the next Airport on another room nearby nothing happens, and signals disconected ....
    is the signal so weak that is not able to go to ono room to the other ?

    Well, even if you have the first express set up to extend the network, the second express can only extend from the TimeCapsule.
    Maybe you got walls of sheetrook in the way, or kitchen/bathroom tiles, etc, dampening the signal rapidly.

  • Can't access "My Verizon" after moving, can't pay bill online

    I just moved into my new home. Before moving, I used Verizon Fios tripal play without contract. Now I use Verizon Fios double play on contract. Everything else looks fine, except for my online account. I can't see "Bill and payment" part of My Verizon any more, immediately after I placed the moving order, although I can still log into my account as usual. It seems my old username and password are still valid. The log in process seems normal. I still have access to the verizon e-mail service. But every time when I try to open the "Bill and Payment" page, it shows "We are unable to process your request at this time. Please try again later. We apologize for any inconvenience."  Heck! I've been trying again and again for Three weeks! I also don't have access to " My rewards". It says: "You do not have sufficient permissions to access this page." "My Service" part is also abnormal. I can't see my current plan. It seems I have access to the "Profile" part. I have tried twice to call I-800-Verizon. They can't help. Can somebody here help me?

    Hi rmuzchybo,
    Your issue has been escalated to a Verizon agent. Before the agent can begin assisting you, they will need to collect further information from you. Please go to your profile page for the forum and look at the top of the middle column where you will find an area titled "My Support Cases". You can reach your profile page by clicking on your name beside your post, or at the top left of this page underneath the title of the board.
    Under "My Support Cases" you will find a link to the private board where you and the agent may exchange information. The title of your post is the link. This should be checked on a frequent basis, as the agent may be waiting for information from you before they can proceed with any actions. To ensure you know when they have responded to you, at the top of your support case there is a drop down menu for support case options. Open that and choose "subscribe". Please keep all correspondence regarding your issue in the private support portal.

  • HT4623 How can I troubleshoot my mailbox after buying a used phone through E-bay I cannot access my Voicemail

    After buying a used phone I cannot access my voicemail messages, how can I re-set or troubleshoot, it keep asking me for my mailbox number,  can I reset the mailbox message  on my phone ?

    You need to contact your carrier to reset your voicemail. You should also wipe the phone if you haven't already: Settings/General/Reset - Erase all content and settings.

  • How can I display historical data after moving a PLC to another port?

    I have a system that has Modbus type devices on serial ports. Each device has a number of values logged (perpetually) to Citadel. Over the years the number of devices has grown and I'd like to move some of the load to other com ports. In fact I'll probably use an OPC server. What I really need is an elegant method and/or sequence to implement the changes. In particular I'm concerned about hypertrends that need to show both the before and after traces. The traces will be the same physical points, but the names will change with the new paths.
    How do others handle this?
    Thanks,
    Bob Lockert

    Upon reflection, I see the first part of your comment to be valid. I chose tag names that indicated port and RTU addresses. Thus Mod6_35.4xxx was device 35 on com port 6. I can in fact move some of those devices to another port by simply changing the configuration of the devices to be moved. I just can't revise the tags to show the new port and address numbers.
    However, I do want to run through an OPC Server so the tag name won't and/or can't follow. They'll be different device types. I have considered changing the hypertrends to display an expression which is the sum of two separately logged items.
    ie Temperature = OldLoggedTemp + NewLoggedTemp
    Comments???
    Bob

  • Can't change payment info after moving country

    Recently moved from UK to USA, can't change credit card info to a USA credit card as it keeps requiring a post code (rather than a zip code). I have tried to change country within settings >iTunes and App Store>Apple ID etc but when I click 'change country' nothing happens at all, it just sits there, staring blankly back at me. Have been looking online for answers but can't seem to find this problem. It is also a pain because I can't update anything or even download free apps without a valid credit card which is pretty long, as I was bossing deer hunter 2k14 at work and now can't go any further on it. Also been waiting in queue to talk to someone on chat for over 50 minutes after a projected 2 minute wait so not overly impressed with Apples customer service.

    I bought my daughter a MacBook Pro when she went away to college, and I then transfered my music collection from my computer into her iMac (which she no longer uses, so I do). Like xLegend above, I cannot change the info on the songs on the iMac.
    The collection consists of songs I bought at the iTMS to a small degree, and songs I have ripped from my CD collection to a larger degree. There are also a number of songs that I have composed myself using Pro Tools and GarageBand, and I cannot change the info even on those...
    Does anyone have an idea why this is, and how I can reclaim the ability to change information on the songs in my collection? Thank you for your help.
    -Patrick

  • Can't create new files after moving to ext drive, LR4

    I moved all photos to a new ext drive (they used to be on the c drive); reformatted my desktop computer; reinstalled LR4. 
    Now there is no parent file under the name of the ext drive on which I can right click and "create a folder inside....".  I am able to create new folders in the existing subfolders.
    There is also no way to sync the drive to find a new folder I created via Windows explorer.
    My filing system is by month and year so now with each passing month I am not able to set up a new file.
    Help!

    Can you right-click on a folder name in the Lightroom Folder Panel and select "Show Parent Folder"?
    Can you import new photos directly to the desired folder in the desired location?

  • Can't find the pictures after moving the library to EHD

    I followed the instructions of moving the iphoto library to the external HD. I created an alias and moved it to the Pictures folder. I opened IPhoto and I can see all the events and thumbnails, however when I try to open any picture and I get the message that the picture is not found. I guess is that the picture files are located outside the library. the library has the pointers to the old folders....
    I have 17000 pictures, how can I find each of them?
    I tried opening IPhoto with the "option" key pressed and choosing the library in the EHD. I get the same result. I can see all the events and thumbnails but It can't find the pictures.
    Message was edited by: calfon1

    Did you try opening and checking the validity of your library before you copied it back to the EHD? By not finding some of the photos do you mean you get the "!" window when you double click on a thumbnail?
    If so then try the two fixes below in order as needed:
    Fix #1
    1 - delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your User/Library/Preferences folder.
    2 - delete iPhoto's cache files that are located in the User/Library/Caches/com.apple.iPhoto folder.
    3 - reboot, launch iPhoto and try again.
    NOTE: If you're moved your library from its default location in your Home/Pictures folder you will have to point iPhoto to its new location when you next open iPhoto by holding the the Option key. You'll also have to reset the iPhoto's various preferences.
    Fix #2
    Launch iPhoto with the Command+Option keys depressed and follow the instructions to rebuild the library. Select options #1 and #6.
    If all else fails create a new empty library on the EHD and do the following: sart over with a new library and import the Originals folder from your original library as follows:
    Creating a new library while preserving the Events from the original library.
    1. Move the existing library folder to the desktop.
    2. Open the library package like this.
    Click to view full size
    3. Launch iPhoto and, when asked, select the option to create a new library.
    4. Drag the Originals folder from the iPhoto Library on the desktop into the open iPhoto window.
    This will create a new library with the same Events as the original library if you have the Finder checkbox unchecked in the Events preference pane.
    Then you can compare the number of photos between this library and the other to see if either is more complete.
    Message was edited by: Old Toad

  • Can i delete iphoto data after moving to aperture?

    I am trying to clean up my hard drive and I'm wondering if I can delete the following information now that I have moved to Aperture:
    1. images in the "Pictures" folder which are there for some reason I don't understand
    2. "IPhoto Library Recovered Photos" folder
    3, "IPhoto Library Recovered Photos_2" folder
    4. "iPhoto Slideshows" folder
    5. "Rebuilt Library" file which shows as being a " iPhoto Library" Kind of file.
    Collectively these seem to take up 50 GB of data and I am trying to get clear of my nasty and brutish port to mac from a PC environment (not pretty and not easy).
    TIA

    Hi Terence.
    Thank you!
    Can I please ask you what I should look at on 5? It sounds like there is a a question as to whether my "port" from iPhoto to Aperture dragged the images out of the iPhoto database and into the Aperture database?
    Is there a way to check on this?
    Thanks.

  • Can't unlock my HDD after moving it

    Hello,
    Can any one help me how to unlock my HDD if it was locked through lenovo B550 notebook and i moved it to a new laptop acer aspira noting that the old laptop lenovo is not available any more.
    I tried to type the correct password many times but the acer laptop is giving me a error message that it's a wrong password while it was working fine on the lenovo laptop.
    Thanks lot for your reply

    Hello,
    Can any one help me how to unlock my HDD if it was locked through lenovo B550 notebook and i moved it to a new laptop acer aspira noting that the old laptop lenovo is not available any more.
    I tried to type the correct password many times but the acer laptop is giving me a error message that it's a wrong password while it was working fine on the lenovo laptop.
    Thanks lot for your reply

  • Can't automatically play songs after moving music

    I used my iPod to move my music to a new computer by following the instructions in article #300173 (http://docs.info.apple.com/article.html?artnum=300173)
    All appeared to go well. The library and playlists looked liked they are on the first computer but when I go to play a song(s) on the second computer, I get an error message saying:
    "The song "song title" could not be used because the original file could not be found. Would you like to locate it?"
    When I say "Yes", I'm taken to the iTunes Music folder in My Music, where I then have to MANUALLY associate each song to it's original. This is extremely incovenient because I have 500+ songs at this time.
    Any ideas on how to automatically associate each song?
    Thanks so much.
    Lucia August

    I'm having the same problem. No one who knows how to fix this?

  • Can an account be deactivated after a specified period of time?

    Hi,
    I have a requirement to make the accounts of Contractors expire after 90days.
    Is it possible to do it by configuring rules or some other way in OIM?
    Any help would be highly appreciated.
    Thanks

    There is an end date on the USR form. If you want to expire the contractor accounts after 90 days just set the end date to ($today+90 days) on account creation.
    I would suggest checking with the business if they need a contractor keep alive feature where someone, i.e. the contractors manager, can extend the life time. You will probably also need some kind of reminder functionality, i.e. one email sent out a few days before termination.
    Hope this helps
    /M

  • Can't edit folder info after importing & editing using iTunes... Help.

    I've notice that when editing CD info after importing into iTunes that sometimes folder names in my music library, under itunes media/music, does not match the info that I've just edited in iTunes. When attempting to edit the folder's name I have to add the folder into iTunes again, to locate music files after edit change (?), only to have the edited folder name switch back to the previous name. Is there something that needs to be disabled. I've looked all over but can't seem to find help for this particular situation.

    Hi, welcome to Apple Discussions.
    iTunes can't or won't use certain characters in file & folder names and uses a maximum of 40 characters for the file or folder name, inclusive of any extention such as ".mp3" (=4 chars). If you manually rename anything iTunes will lose track of it. The best advice is simply to leave iTunes to it. Once you've thrown the data into it, iTunes will get it back for you when you ask, so why does it matter how iTunes chooses to organize it? Saldy, I can't follow my own advice and choose to keep my library organized manually. These days I use some custom scripts to move things around and update iTunes in one process, but in the past I would tidy up my tags, amend the file & folder names, then remove the album from iTunes & reimport.
    tt2

  • Why can't I start Mac after installing Windows using boot camp???

    I'm new to Mac.... Have installed Windows 7 through Bootcamp... Well, I tried to at least!!  I can now only get into Windows every time I start the mac up.... What have I done wrong - and how do I fix it!?!

    Flying kiwis wrote:
    Thanks Vinmar.... I can't see anything down on the bottom fit of my screen, apart from the time, date, connectivity, speaker volume etc. am I looking in the wrong place??
    The restart in Mac OS X icon (a grey diamond) will only appear after you've installed the Boot Camp drivers. If you installed the drivers, try clicking on the sideways triangle to show any hidden system tray icons.  You can also use the boot camp control panel to restart in Mac OS X.
    For how many partitions you have, you should be able to see those in the Disk Utility application in Mac OS X or the Disk Management app in Windows.  Be careful not to delete any of them.  If you want to remove a partition, I'd use the Boot Camp Utility to do that.  Nore as well that OS X 10.7 and above add a hidden recovery partition to your drive that you won't see in Disk Utility but will see in the Windows app. 
    Hope this helps.
    Cheers,
    Vinmar

Maybe you are looking for

  • How to reinstall (comppletely fresh) iPhone OS 3.1.2

    Hi, I have some issues with my iPhone and as per the instructions of my carrier, I need to reinstall iPhone OS from scratch. They offered me the service to reinstall OS but I didn't had backup of my phone and hence I want to do it at home now. I sear

  • Why do my applications hang (Mail, Disk Utility, Installer, Safari)

    After the latest software update. Mail, Safari, Disk Utility, Installer, Activity monitor and some more applications do nothing more than jumping in the Dock and then hang-up with the spinning wheel always spinning... I think it was after the 2006-00

  • Installing Leopard using External Monitor

    I recently had an accident with my Macbook Pro, and even though the screen is now totally worthless, EVERYTHING else works. (Talk about a testimony story.) It works fine when I hook up an external monitor. I need to reinstall Leopard on it, but when

  • Using PCK with  XI3.0

    Greetings, I have installed the PCK SP5 running on J2EE server. The PCK GUI is working fine. we have also configured a simple scenario to send a File from PC (where the PCK is installed) to XI. In the XI directory when I tried to configure the Commun

  • Lightweight access-point joined the wireless controller but no radio channels

    a customer  wireless controller 2106  he use  access-point AIR-LAP1252G-E-K9  the access point the leds indicate etherner and radio is blinking green and status is green. please help i am in the customer company now