Getting my program to send message to server when you click X

I have a client application, it has the minimize, expand, close buttons at the top right cornor like most applications, i have tried using windowlistener but that doesnt work, i want whenever a user clicks the X (close) to send a message to my server saying "bye" and then close the socket connection with the server, thats easy, i just cant figure out how to listen for when a user clicks that X button.
I can post my code if i need to

I think I know what your problem is.... assuming that you aren't making an applet, you have to set you close operation to do nothing and then inside of the window closing event exit the programm, so....
MyGui myGui = new MyGui();
myGui.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
/*and then your windowClosing method should look like this*/
addWindowListener(new WindowAdapter(){
     public void windowClosing(WindowEvent e){
          out.println("bye");
                System.exit(0);
});

Similar Messages

  • When I open mail I get a list of the messages received but when I click on a message it does not displaying the main window. I have 2 different mail accounts

    Just bought a new MacMini(my first Apple PC) and when I open mail I get the brief details of mail received but whe I click on the message to read the details I get a "loading" sign but the message is not displayed.
    Any help for a Dumbo would be appreciated.

    Very strange, do you have any AV or Web filtering apps like Norton installed?
    Do the working accounts use a different Port or Authentication than the non-working one?
    The receiving email ports are:
    IMAP is port 143
    IMAP-SSL is port 993
    POP is port 110
    POP-SSL is port 995

  • No more spinning beach ball when you click on get mail?

    Hi
    I just bought a new iMac.
    I did not have M/L on my old machine. In the mail program in it (it had Lion) when you clicked on the Get Mail button, a beach ball would spin to let you know that it was looking for mail. There is no spinning beach ball in the M/L mail program. So, how do I know that it is working? Other then when an email shows up in the in box?
    Thanks
    rlmslo

    OS X 10.8 Mountain Lion
    Mail 6.2
    The "spinning gear"  activity indicator is no more available in Mountain Lion.
    Apple removed it.
    There is a "MAIL ACTIVITY" progress bar available in the left sidebar.
    Best.

  • Suddenly, thunderbird doesn't connect to remote server when i click "get messages".

    Linux (ubuntu studio), 64 bit. Suddenly, thunderbird doesn't connect to remote server when i click "get messages". It just says "(account name): Connected to (mail server)" for a second or two at the bottom, then nothing. In the server logs, i get:
    popa3d[6408]: Didn't attempt authentication
    Trying to get my e-mail also seems to cause a bunch of these errors on the server:
    (server) kernel: [18295.775491] lockd: cannot monitor laptop
    where "laptop" is the client machine.
    The problem seems to be caused by my mailbox files (Inbox and Inbox.msf) - when i create a clean ~/.thunderbird directory, i can get my e-mails, but when i place my mailbox files in this account's Mail directory, the problem comes back. Even if i place it as another name, and not Inbox.

    I should add the following information:
    - Neither "safe mode" or rebuilding the global-messages-db.sqlite file fixes the problem.
    - Seamonkey has no problems with my Inbox and Inbox.msf file.
    - The Inbox and Inbox.msf files are symlinks to files on a NFS filesystem.
    - Downgrading to an earlier version of thunderbird doesn't fix the problem.
    - Even if i remove the mail file from an account, the problem persists.
    - I confirmed that i can telnet to the server on the pop3 port and login with the raw protocol.
    The above mentioned lockd errors make me think this is a NFS related error, but if that's the case, why is seamonkey able to read my Inbox file without problems but not thunderbird?

  • What do you do when you can't connect to the internet and you get this message XUl Runner after you click on the icon to open Mozilla? Then it says error platform'1.9.2.16 is not campatible wwith minVersion =1.9.2.17 maxVersion 1.9.2.17

    I can't get the internet to open and when you click on the icon to open firefox the above message is displayed and I don't know how to fix what is causing the error.

    Do a clean (re-)install:
    * Download a fresh Firefox copy and save the file to the desktop.
    * Firefox 3.6.x: http://www.mozilla.com/en-US/firefox/all-older.html
    * Firefox 4.0.x: http://www.mozilla.com/en-US/firefox/all.html
    * Uninstall your current Firefox version and remove the Firefox program folder before installing that copy of the Firefox installer.
    * Do not remove personal data if you uninstall the current version.
    * It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    Your bookmarks and other profile data are stored elsewhere in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder] and won't be affected by a reinstall, but make sure that you do not select to remove personal data if you uninstall Firefox.

  • TS3899 getting an error, "unable to connect to server" when trying to access his yahoo email account. no different user name/wifi is off.

    getting an error, "unable to connect to server" when trying to access yahoo email account.  I did not change my password, but now everytime I try to access my email from my IPhone 4s, I get the error.

    Try the Yahoo mail app.

  • I am trying to update my iphone 4 icloud but I keep getting can not connect to server when I click on the terms and conditions

    I am trying to update my iphone 4 icloud but I keep getting can not connect to server when I click on the terms and conditions

    " iTunes could not contact the iPhone software update server because you are not connected to the internet.  Make sure your internet connention is active and try again."

  • How to push the offline chat messages to server when internet is available

    I am building chat application in windows phone 8.1 When internet is not available in the device i am storing all chat messages in sqlite database. I want push those messages to server when internet is available later even thought app is not open/active.
    please help me to solve this problem. thank you 
    vinay

    The best approach likely would be to use triggered background tasks. There is a specifc trigger for "InternetAvailable" which looks like a perfect match for your requirement. This article describes that feature in more detail:
    https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh977058.aspx
    If I remember correctly however usage of SQLite in background tasks can be somewhat problematic (my information on that may be old however). My suggestion in that case would be to serialize the messages into an XML file when your App is suspended/closed
    which is likely to be a lot easier to handle in the background task (regular storage can remain in the SQLite database).

  • I have been unable to download adobe acrobat pro, which I purchased on a month to month basis almost exactly 1 year ago, since I purchased it. I just received a renewal email and it had a link to download the program and for the first time when I clicked

    I have been unable to download adobe acrobat pro, which I purchased on a month to month basis almost exactly 1 year ago, since I purchased it. I just received a renewal email and it had a link to download the program and for the first time when I clicked on the link it actually sent me to a page that had the icon to download now. I clicked on that, but when I went to open the file and start downloading after about 3 minutes into downloading it says an error had occurred. Can anyone help me?

    I am a little worried. If you are an existing subscriber why would Adobe need you to download... I wonder if the message is a fake.
    I'm not clear, if you've had it for a year, whether you need to download, or you are just following the email?
    This page with the icon to download now. Was it a page on adobe.com ?

  • I could do this before installing Maverick but cannot do it now.It is nice and convenient how Mac OS X Mail displays messages semi-automatically when you just select them. But wouldn't a bigger view of the mailbox be useful sometimes? Yes, and it's easier

    It is nice and convenient how Mac OS X Mail displays messages semi-automatically when you just select them. But wouldn't a bigger view of the mailbox be useful sometimes?
    Yes, and it's easier to get than you maybe think.
    Hide the Preview Pane and Delete Mail Without Opening It in Mac OS X Mail
    To hide the message preview pane in Mac OS X Mail:
    Double-click the bar that separates the message pane from the mailbox pane.
    Now, to delete any email:
    Highlight the message or messages you want to delete.Hold down the Command key while selecting with the mouse to highlight multiple emails and Shift to highlight a range.
    Press Del.
    To get the preview pane back, double-click the same bar again.
    Cannot do this now since installing Maverick

    It is nice and convenient how Mac OS X Mail displays messages semi-automatically when you just select them. But wouldn't a bigger view of the mailbox be useful sometimes?
    Yes, and it's easier to get than you maybe think.
    Hide the Preview Pane and Delete Mail Without Opening It in Mac OS X Mail
    To hide the message preview pane in Mac OS X Mail:
    Double-click the bar that separates the message pane from the mailbox pane.
    Now, to delete any email:
    Highlight the message or messages you want to delete.Hold down the Command key while selecting with the mouse to highlight multiple emails and Shift to highlight a range.
    Press Del.
    To get the preview pane back, double-click the same bar again.
    Cannot do this now since installing Maverick

  • After altering the "Processes" list in Task manager, almost all of my programs show the iTunes icon, and when I click on, for example, Firefox, iTunes will load. Uninstalling iTunes restores the normal loading of other programs, but re-installation of iT

    After altering the "Processes" list in Task manager, almost all of my programs show the iTunes icon, and when I click on, for example, Firefox, iTunes will load. Uninstalling iTunes restores the normal loading of other programs, but re-installation of iTunes makes the problem recur. Any answers?

    First I'd set up a System Restore point. Then try applying the LNK registry fix from the following document:
    File Association Fixes for Windows 7
    Does that get your icons back to normal?

  • I'm on a website that usually when you click on the open chat(popup) link it opens a certain now, but now they are opening maximized all the time. How do I get them to open the proper size?

    It was opening the proper size and now it doesn't

    Works normally for me. The script that runs when you click the link will check to see if it already opened a window and try to switch to it, but if you are starting from scratch, this shouldn't be an issue.
    There probably are quite a few add-ons that affect popup window behavior. To see whether an add-on could be responsible, you could test the page in Firefox's Safe Mode.
    First, I recommend backing up your Firefox settings in case something goes wrong. See [https://support.mozilla.com/en-US/kb/Backing+up+your+information Backing up your information]. (You can copy your entire Firefox profile folder somewhere outside of the Mozilla folder.)
    Next, close Firefox, hold the Shift key, then restart Firefox. You will get a [https://support.mozilla.com/kb/Safe+Mode Safe Mode dialog]. Just click "Continue in Safe Mode" and do not "reset" anything just yet.
    If the window displays at the specified size in Safe Mode, one of your other add-ons (especially in the Extensions category) may be overriding it.

  • Firefox has remberd a password to a website ... chessatwork and I get loged in to my main page and when I click on any link it takes me right back to my log in page, where it has it stored.... password and user name,,, whats up and how do I turn that off?

    Firefox has remberd a password to a website ... chessatwork and I get loged in to my main page and when I click on any link it takes me right back to my log in page, where it has it stored.... password and user name,,, whats up and how do I turn that off? chessatwork has ran great for me for many yrs, then one day I down loaded firefox and went to play chess on this site chessatwork.com, well the window popped up asking to remember the log in and pass word and so I said ok, and it did, but now when I click log in and I go to my main page (home) and click on any link, say to play game I return right back to log in

    See http://kb.mozillazine.org/Deleting_autocomplete_entries<br />
    Remove a saved password here: Tools > Options > Security: Passwords: "Saved Passwords" > "Show Passwords"
    You may also need to remove the cookies from that website.<br />
    * Tools > Options > Privacy > Cookies: "Show Cookies"

  • Why can't I get the image to view larger when you click on a thumbnail?

    I thought that there was a way to have the image open up larger in a new little window when you click the thumbnail on a photos page....when I click a thumbnail on my photos page it takes me right to slideshow view and the images are displayed too small to see fine detail (I am a retoucher, so my clients need to be able to see hi res images) I can't find a way to change the size of the slideshow images or to get my thumbnails to click open to a hi res version in a new window. The only solution I can think of is to use a blank template page, make each small image a link to a hidden page with the image at hi resolution....but this would take forever and I would have a gazillion pages on my site that way. Any idea how to get around this. Seems like the older version of iweb didn't have this problem...????
    (for an example of what I mean, my site: http://www.katesilsby.com (retouch page) and what old iweb did and what I want to happen: http://web.mac.com/vogier/iWeb/vivian%20ogier/wardrobe.html

    (for an example of what I mean, my site: http://www.katesilsby.com (retouch page) and what old iweb did and what I want to happen: http://web.mac.com/vogier/iWeb/vivian%20ogier/wardrobe.html
    iWeb2 photos page is completely different from that of iWeb1.
    iWeb2 photos page can be retro back to iWeb1, but not without major javascript coding.
    or using completely different previewing method for larger image, example: http://hdl.50webs.com/Lytebox/Photos.html

  • Since installing the last iPhoto update sharing a photo via e-mail opens a google e-mail format instead of an Apple Mail format.  How can I get the Apple Mail format to come up when I click on share?

    Since installing the last iPhoto update sharing a photo via e-mail opens a google e-mail format instead of an Apple Mail format.  How can I get the Apple Mail format to come up when I click on share?

    iPhoto preferences - set the email client to Mail
    LN

Maybe you are looking for