What's a good way to prompt a user with an error message etc. in swing?

i want to be able to prompt the user within a given a function that i've created .. with some kind of warning message or error message .. or anything for that matter ..
is there even a timer of some sort that i could use for the prompt .. say if im connecting and i want to prompt the user with a 'connecting ... ' message .. then close it when ive secured the connection? ...
simple aesthetics i guess .. but a want indeed.

For your first question, just use the static JOptionPane.showXXX methods.
If you are making a connection in another thread, use the SwingUtilities.invokeLater (or in this case even invokeAndWait) method to close the dialog from the other thread.

Similar Messages

  • What are the good ways to send a big file( 20MB-100MB) file to my friend?

    what are the good ways to send a big file( 20MB-100MB) file to my friend?
    Thanks in advance

    if this is with the internet, iChat is probly your best bet,
    but if you just want a transfer,
    plug a firewire into both of your computers, shutdown one of them, hold "T" and press the power button, the restarted computer should pop up as an external drive on the second computer.

  • What's a good way to manage custom schema for DS  5.1?

    What's a good way to manage custom schema?
    Custom Schema for Object Class and Attributes
    The reason I ask this is because there might be a need in the future where I need to export those custome schema into different branded directory server. I just want to make this as painless as possible.
    Right now, I thought of 2 options
    1) Create my own LDIF file with my custom attributes and object classes, so if one day I need to export to another directory server, I can just copy that custom created LDIF file over. (Will this work?)
    2) Create a JAVA application using JNDI. What this Java App. will do is read through a XML file and create those object classes and attributes on-the-fly. (of course, the XML structure will be predefined by me, so that my Java App. will be able to parse through it correctly. Will this work?)
    Anymore suggestion? I would want to hear more advices and suggestions.
    Also, I assume that will work even with replication. All I need to update is the master server, and the slaves will replicate automatically.
    Thank you very much! :)

    Demo: I'm using the nul character to represent the end of the word, so that the data structure can represent that "hell" and "hello" are both in the vocabulary:
    import java.util.*;
    class Node {
        private SortedMap<Character, Node> children = new TreeMap<Character, Node>();
        //0 <= index <= word.length()
        private void add(String word, int index) {
            if (index == word.length()) {
                children.put(Character.valueOf('\u0000'), null);
            } else {
                char ch = word.charAt(index);
                Node child = children.get(ch);
                if (child == null) {
                    children.put(ch, child = new Node());
                child.add(word, index+1);
        public void add(String word) {
            if (word == null || word.length()==0)
                throw new IllegalArgumentException();
            add(word, 0);
        public String toString() {
            return children.toString();
    public class Example {
        public static void main(String[] args) throws Exception {
            Node root = new Node();
            root.add("hello");
            root.add("how");
            root.add("who");
            root.add("hell");
            System.out.println(root.toString());
    }

  • What's a good way to do a thread dump into a separate file

    What is a good way to do a thread dump automatically into a separate file.
    Example. I run a script to do the thread dump, but unfortunetly, it goes into my stdout log file with the rest of my weblogic errors.
    Any ideas? I want it in a separate file when I run my script?

    Do a Google search on "Drobo S" "benchmark."  I don't have a Drobo S, only the regular Drobo.  But here's a guy who tested one on Windows:
    http://mansurovs.com/drobo-s-review-usb-3-0-2nd-generation
    This one has it a bit faster:
    http://the-gadgeteer.com/2011/12/31/drobo-s-storage-array-review/
    Do read up on a few reviews of it, and be absolutely clear that interface speed (i.e. eSATA versus Firewire versus Thunderbolt) is NOT the same as the performance of the system.  The Drobo cannot keep up with any interfaces... at least the Drobo and the Drobo S cannot.
    I am not using the FS model which is a NAS.  I am using the plain old "Drobo" which is slower than the Drobo S, but that's not to say that the Drobo S is fast, because it is not.
    The Drobo in theory is really attractive: Dead simple to manage, can mix and match drive sizes, offers you some data protection, etc.  However do note that protected storage is not, in and of itself, a backup.  You need other backups besides just the data on the Drobo.  And, because it's so slow, it's really not a great fit for photo storage.  See this review from a guy who used to think the Drobo was great for that and then appended his review:
    http://www.stuckincustoms.com/drobo-review/
    To be as clear as possible, IMO the BEST backup strategy with something like Aperture (so long as your managed Aperture library is of a manageable size, like < 800 GB), is to get a few small portable Firewire 800 drives and keep vaults on each one.  They are great because they are easy to use, to have with you, are bus powered, and you WILL offsite them.

  • What is a good way to load 80 million documents in DocumentDB?

    I am having problems loading a large set of data.  We want to load 80 million documents.  We are trying to do testing for an IOT solution that will end up having a lot of data in it.  I followed the instructions to use a stored procedure to
    do a bulk load provided by Ryan CrawCour on the Microsoft Site:
    https://code.msdn.microsoft.com/windowsazure/Azure-DocumentDB-NET-Code-6b3da8af
    But it throws exceptions when we load 2,000 - 5,000 documents.  Our documents are only about 80 characters.
    Error: One or more errors occurred., Message: Exception: Microsoft.Azure.Documen
    ts.RequestRateTooLargeException, message: {"Errors":["Request rate is large"]},
    What is a good way to load large datasets?  ( Load backups, migrate data, ... )  Or is DocumentDB just a wrong choice when you have millions of rows to load?
    Thanks

    Hi,
    I had been working on this from around one month and I am happy to say that my code works. Was able to upload around 0.5 million documents in 20 min. 
    The configuration was Document DB with S3 , I scaled out for 16 collection for sharding, I think you need to shard out more. This will depend on how much each document takes.
    So the Calculation goes like if each document is lets say on an average 2Kb of Size and you have 80 million documents that will come out to be 160GB
    That means you will need more than 16 collections to store as at Max 1 collection can have 10GB of Data. So to be on the safer side I would say lets go for 3 times the storage so 48 collections . If all of them are at S3 than you have 2500 RUs spread across
    48 collections and I am sure if you do insertion now you will not get Request Rate too large exception.
    I have come up with this code hopefully it will help you as well.
    https://social.msdn.microsoft.com/Forums/azure/en-US/d036afe2-78ec-45ee-8b0d-297f0f5320fe/azure-documentdb-bulk-insert-using-stored-procedure.
    For Sharding you can have look at
    https://msdn.microsoft.com/en-us/library/dn589797.aspx?f=255&MSPPError=-2147217396.

  • What is the good way to charge the battery

    I don't know if this topic been answered before.
    I want to know what is the good way to charge the battery on Macbook pro? Should I start charging battery when it's 50% or 20% or 10% left? and Is it good to leave the charge plug in after it fully charged?
    thanks guys

    Everything you need to know about your battery is explained here:
    http://discussions.apple.com/thread.jspa?threadID=1764220

  • What is the BEST way to get my macbook with lion on it, to communicate with my Canon 40D camera?

    What is the BEST way to get my macbook with lion on it, to communicate with my Canon 40D camera? It says the utility disk is a PowerPC app and that is no longer supported. What do I do now? I can't upload photos from my camera.

    Also, I had the same problem happen when I tried to install an older version of Corel Painter. Are Macbook Pro users just NOT supposed to be able to use their laptops for the purposes they are best designed for?
    -Frustrated new Mac user

  • WHat is the best way for other iphone users to share pictures with me?  I am doing a project which req. people to send me 100 pictures at a time that I'll be putting in my iphoto?

    WHat is the best way for other iphone users to share pictures with me?  I am doing a project which req. people to send me 100 pictures at a time that I'll be putting in my iphoto? thank you.

    ingridlisa,
    I'd suggest to ask them to create Shared PhotoStreams and to invite you to view the streams, see:
    iCloud: Using and troubleshooting Shared Photo Streams
    Regards
    Léonie
    Added:
    that I'll be putting in my iphoto?
    Will you be collecting the photos in iPhoto on your iPhone or on a Mac? On a Mac a Shared PhotoStream requires Mac OS X 10.8.2.

  • What is the best way to manage 5 users and 6 devices? We dont all want the same merged contacts, we dont all want the same calendar notes, music, pics etc etc.

    What is the best way to manage 5 users and 6 devices? We dont all want the same merged contacts, we dont all want the same calendar notes, music, pics etc etc.

    As long as it is pointed to iTunes it will be accessible via home sharing on Apple TV.
    http://support.apple.com/kb/HT1751?viewlocale=en_US&locale=en_US
    If these are commercial DVD's we can't comment on any conversion process.

  • What is the proper way to use Siri dictation with punctuation, on iPad with Retina Display?

    What is the proper way to use Siri dictation with punctuation, on iPad with Retina Display?
    Thank you!

    From the iPad User Manual:
    Also:
    no space on ... no space off—to run a series of words together
    smiley—to insert :-)
    frowny—to insert :-(
    winky—to insert ;-)

  • My Mum( a pensioner) is wanting to purchase both an iPhone and iPad.  What is the best way for her to manage her data /calls/txt etc. obviously the cost needs to be as low as possible.  Currently does not have WiFi but uses dongle

    My Mum( a pensioner) is wanting to purchase both an iPhone and iPad.  What is the best way for her to manage her data /calls/txt etc. obviously the cost needs to be as low as possible.  Currently does not have WiFi but uses dongle

    My Mum( a pensioner) is wanting to purchase both an iPhone and iPad.  What is the best way for her to manage her data /calls/txt etc. obviously the cost needs to be as low as possible.  Currently does not have WiFi but uses dongle

  • What is a good external hard drive for use with a macbook air?

    I am looking at purchasing a macbook air 13". What is a good external hard drive to use with it? Should I look for an external hard drive with its own a/c power or is the usb 3.0 capable of powering the external drive.

    Have a look here for the sizes and prices.
    It is however, much better to get a USB external drive that comes with it's own power adapter to avoid issues when or if your USB port can't supply enough power to your external drive.
    That issue however does happen rarely but it does happen.  Especially when connecting other devices to your other USB port while your external hard drive is connected to your other usb port.

  • What is the best way for sharing an iPad with 2 iPhones using different Apple acount ?

    What is the best way for sharing an iPad with 2 iPhones using different Apple acount ?

    You can't share with other devices if you are using different Apple ID's and iTunes account on them. You can only share if you use the same ID.

  • What is a good wireless printer that will work with a macbook and windows laptops?

    What is a good wireless printer that will work with a macbook and windows laptops?

    Any printer that visibly supports OS X will work fine. My personal recommendation is Brother, followed rather distantly by Canon.
    Recently I have grown to favor Brother printers over the others. They are inexpensive, their OS X integration is well-implemented, their consumables are reasonably priced, and their technical support is free forever. If you need to call them and explain that you have a Mac, you will immediately receive competent assistance.
    The third and subsequent choices are so far down from those two they're not worth mentioning. I have grown to dislike HP printers, for all the above reasons.
    Read user reviews from vendor websites - Amazon is a good place to start, since Amazon lets people write almost anything they want... right, wrong, or completely idiotic.
    Read the reviews on the respective manufacturers' websites as well, but consider the likelihood of them deleting negative reviews.
    Process all those user reviews employing your own common sense, and draw your own conclusions.
    Consider AirPrint compatibility for future needs. Those features add very little to the price over a USB - only or wireless printer. Understand that not all wireless printers are AirPrint compatible - AirPrint must be specifically indicated. Choose among this list: http://support.apple.com/kb/ht4356
    After OS X compatibility, the next consideration should be the cost of consumables. Laser printers are cheaper than inkjets in that regard.
    Here is a list of AirPrint compatible Brother printers and multifunction devices

  • My ipod 60gb classic is showing as fully charged until I connect it to my pc when it comes up with the error message, 'please wait very low battery' and the little wheel goes round and nothing happens, can anyone explain why this is and what i can do?

    My ipod 60gb classic is showing as fully charged until I connect it to my pc when it comes up with the error message, 'please wait very low battery' and the little wheel goes round and nothing happens, can anyone explain why this is and what i can do?

    I have worked my way through the assistant and nothing works. I have tried connecting in disc mode but although the screen on the ipod is showing that the device is charged and that it is in disc mode as soon as I connect it to the computer it comes up with the error message 'please wait very low battery' and stays like that until I disconnect when it appears to be OK again. I have tried on both pc and mac.
    BTW the ipod is an ipod video not classic if that makes any difference.
    Thanks

Maybe you are looking for

  • How do I move new photos to an album

    That is one question.  iPhone 4s. I have created an album.  I select each potho individeually.  Then I can copy them, but cannot then find the album into which I want to paste. Is there no way to select a group of photos on the phone? Second question

  • Issue from updating spry from 1.4 to 1.6.1

    I have an .xml file that carries the information for a table created by spry. Below is an example of how I wrote the address node in v!.4 There were no problems in writing the code this way and it displayed as desired. After the update to v1.6.1. The

  • Printing text at particular position in SAPscript

    Hi All, I want to print text at particular position, I used Command POSITION but it is not working . As I am using counter as Y position for a box and i want to print lines of text in that box. since I am able to position box according to counter but

  • Convert to RGB Color Mode (Windows XP/CS4)

    It appears I have to change an image from indexed color mode to RGB mode. Can someone please tell me how to do that? Thanks!

  • Applet jerks when moving a window over it

    Hi together ! I'm programming an applet at the moment. In that I move many pictures from up to down so an turning effect comes up. I have realised this with the grapics objekt from Java and the Graphics.drawImage() methode. I begin to draw the pictur