Please, help with simple modal progress dialog

Progress dialog will create a reader thread and block user input to main form until read is completed. It will have only a number of bytes received text message and one cancel button. It will be closed when user presses the button or thread is done with reading.
I understand the principles of IO and thread communication very well. I'm asking for modal dialog candidate. Should I override JDialog or it is possible to use JOptionPane or something else? The modal dialog should be able to register some listener to get progress messages from the reader thread.

JOptionPane should be really easy way to go, since you can pass in an Object, and that object
could be a JPanel containing your JProgressBar and any other components/layout you want.

Similar Messages

  • Please help with simple Drag N Drop

    I’m desperate and need some help with this simple drag
    and drop. Here is the scenario…this animation is for a
    kindergarten course. I have 6 different colored teddy bears on the
    floor and the bears are to be placed on the middle shelf in the
    room, in no particular order. I have the code in place to drag the
    bears, and they return to their original location if dropped in the
    wrong area. Everything works, except I can’t make the bears
    stick to the target area. The target area has to be the same for
    all 6 bears. Can someone help me out with this?
    I have a feeling that the problem has something to do with my
    instance names, but I have tried everything I can think of and
    cannot get it to work. Is there some way I can post, send, or
    attach my .fla file for someone to look at? I’m desperate.
    PLEASE HELP!

    var startX3:Number;
    var startY3:Number;
    var counter3:Number=0;
    vf_A.addEventListener(MouseEvent.MOUSE_DOWN, pickUp3);
    vf_A.addEventListener(MouseEvent.MOUSE_UP, dropIt3);
    vf_E.addEventListener(MouseEvent.MOUSE_DOWN, pickUp3);
    vf_E.addEventListener(MouseEvent.MOUSE_UP, dropIt3);
    vf_I.addEventListener(MouseEvent.MOUSE_DOWN, pickUp3);
    vf_I.addEventListener(MouseEvent.MOUSE_UP, dropIt3);
    vf_O.addEventListener(MouseEvent.MOUSE_DOWN, pickUp3);
    vf_O.addEventListener(MouseEvent.MOUSE_UP, dropIt3);
    vf_U.addEventListener(MouseEvent.MOUSE_DOWN, pickUp3);
    vf_U.addEventListener(MouseEvent.MOUSE_UP, dropIt3);
    function pickUp3(event:MouseEvent):void {
    event.target.startDrag(true);
    reply2_txt.text="";
    event.target.parent.addChild(event.target);
    startX2=event.target.x;
    startY2=event.target.y;
    function dropIt3(event:MouseEvent):void {
    event.target.stopDrag();
    var myTargetName:String="target"+event.target.name;
    var myTarget:DisplayObject=getChildByName(myTargetName);
    if (event.target.dropTarget != null &&
    event.target.dropTarget.name == "instance112") {
    reply2_txt.text="Good Job!";
    event.target.removeEventListener(MouseEvent.MOUSE_DOWN,
    pickUp3);
    event.target.removeEventListener(MouseEvent.MOUSE_UP,
    dropIt3);
    event.target.buttonMode=false;
    event.target.x=myTarget.x;
    event.target.y=myTarget.y;
    var mySound:Sound = new vowels_NAR_goodjob();
    mySound.play();
    counter3++;
    } else {
    reply2_txt.text="Try Again!";
    event.target.x=startX2;
    event.target.y=startY2;
    var mySound2:Sound = new vowel_NAR_nopetryagain();
    mySound2.play();
    if (counter2==5) {
    reply2_txt.text="Great Job! You did it!";
    gotoAndPlay(3300);
    vf_A.buttonMode=true;
    vf_E.buttonMode=true;
    vf_I.buttonMode=true;
    vf_O.buttonMode=true;
    vf_U.buttonMode=true;

  • Please help with simple esle code

    Hi all
    Please can someone tell what I am doing Wrong with tis code.
    I just can not see it
    Please Help Me
    Craig
    void ShippAddressjCheckBox_actionPerformed(ActionEvent e) {
    if (ShippAddressjCheckBox.setSelected(true ));
    CopyAddress1();
    else (ShippAddressjCheckBox.setSelected(false ));
    ClearShippingAddress();
    }

    Thanks for that
    this is what I have done
    void ShippAddressjCheckBox_actionPerformed(ActionEvent e) {
    if (ShippAddressjCheckBox.setSelected(true ))
    CopyAddress1();
    else if (ShippAddressjCheckBox.setSelected(false)) {
    ClearShippingAddress();
    I can seam to get it to work
    Thanks

  • PLEASE HELP WITH SIMPLE RESET QUESTION!!!

    This is probably extremely simple to resolve...my Nano is not syncing with my computer any more. I thought I should try resetting it. I looked at the manual and pressed MENU and the CENTRE BUTTON at the same time and waited for the Apple logo to appear. I tried several times but it did not work!
    WHAT AM I DOING WRONG, PLEASE??

    When you restore the ipod, you need to press the menu and select (centre) button together for about 6 seconds. Try to be sure that your finger on the centre button does not touch the wheel part, and that the one on the menu button is closer to the outside edge.
    This page has more information http://support.apple.com/kb/HT1320

  • Please help with simple Classes understanding

    Working further to understand Class formation, and basics.
    At the Java Threads Tutorial site:
    http://java.sun.com/docs/books/tutorial/essential/threads/timer.html
    Goal:
    1)To take the following code, and make it into 2 seperate files.
    Reminder.java
    RemindTask.java
    2)Error Free
    Here is the original, functioning code:
    import java.util.Timer;
    import java.util.TimerTask;
    * Simple demo that uses java.util.Timer to schedule a task
    * to execute once 5 seconds have passed.
    * http://java.sun.com/docs/books/tutorial/essential/threads/timer.html
    public class Reminder {
        Timer timer;
        public Reminder(int seconds) {
            timer = new Timer();
            timer.schedule(new RemindTask(), seconds*1000);
        class RemindTask extends TimerTask {
            public void run() {
                System.out.println("Time's up!");
                timer.cancel(); //Terminate the timer thread
        public static void main(String args[]) {
            new Reminder(5);
            System.out.println("Task scheduled.");
    }Here is what I tried to 2 so far, seperate into 2 seperate files:
    Reminder.java
    package threadspack;    //added this
    import java.util.Timer;
    import java.util.TimerTask;
    * Simple demo that uses java.util.Timer to schedule a task
    * to execute once 5 seconds have passed.
    * http://java.sun.com/docs/books/tutorial/essential/threads/timer.html
    public class Reminder {
        Timer timer;
        public Reminder(int seconds) {
            timer = new Timer();
            timer.schedule(new RemindTask(), seconds*1000);
        public static void main(String args[]) {
            new Reminder(5);
            System.out.println("Task scheduled.");
    }and into
    RemindTask.java
    package threadspack;  //added this
    import java.util.Timer;
    import java.util.TimerTask;
    import threadspack.Reminder; //added this
    * http://java.sun.com/docs/books/tutorial/essential/threads/timer.html
    public class RemindTask extends TimerTask
    Timer timer; /**here, I added this, because got a
    "cannot resolve symbol" error if try to compile w/out it
    but I thought using packages would have negated the need to do this....?*/
         public void run() {
                System.out.println("Time's up!");
                timer.cancel(); //Terminate the timer thread
    }After executing Reminder, the program does perform, even does the timing, however, a NullPointerException error is thrown in the RemindTask class because of this line:
    timer.cancel(); //Terminate the timer thread
    I am not sure of:
    If I have packages/import statements setup correctly
    If I have the "Timer" variable setup incorrectly/wrong spot.
    ...how to fix the problem(s)
    Thank you!

    Hi there!
    I understand that somehow the original "Timer" must
    be referenced.
    This is a major point of confusion for me....I
    thought that when importing
    Classes from the same package/other packages, you
    would have directly
    access to the variables within the imported Classes.I think you have one of the basic points of confussion. You are mixing up the concept of a "Class" with the concept of an "Object".
    Now, first of all, you do not need packages at all for what you are trying to do, so my advice is you completely forget about packages for the moment, they will only mess you up more. Simply place both .class files (compiled .java files) in the same directory. Your program is executing fine, so that indicates that the directory in which you have your main class file is being included in your classpath, so the JVM will find any class file you place there.
    As for Classes/Objects, think of the Class as the map in which the structure of a building is designed, and think of the Object as the building itself. Using the same technical map the architect defines, you could build as many buildings as you wanted. They could each have different colors, different types of doors, different window decorations, etc... but they would all have the same basic structure: the one defined in the technical map. So, the technical map is the Class, and each of the buildings is an object. In Java terminology, you would say that each of the buildings is an "Instance" of the Class.
    Lets take a simpler example with a class representing icecreams. Imagine you code the following class:
    public class Icecream{
         String flavor;
         boolean hasChocoChips;
    }Ok, with this code, what you're doing is defining the "structure" of an icecream. You can see that we have two variables in our class: a String variable with the description of the icecream's flavor, and a boolean variable indicating whether or not the icecream has chocolate chips. However, with that code you are not actually CREATING those variables (that is, allocating memory space for that data). All you are doing is saying that EACH icecream which is created will have those two variables. As I mentioned before, in Java terminology, creating an icecream would be instantiating an Icrecream object from the Icecream class.
    Ok, so lets make icrecream!!!
    Ummm... Why would we want to make several icecreams? Well, lets assume we have an icecream store:
    public class IcecreamStore{
    }Now, we want to sell icecreams, so lets put icecreams in our icecream store:
    public class IcecreamStore{
         Icecream strawberryIcecream = new Icecream(); //This is an object, it's an instance of Class Icecream
         Icecream lemonIcecream = new Icecream(); //This is another object, it's an instance of Class Icecream
    }By creating the two Icecream objects you have actually created (allocated memory space) the String and boolean variable for EACH of those icecreams. So you have actually created two String variables and two boolean variables.
    And how do we reference variables, objects, etc...?
    Well, we're selling icecreams, so lets create an icecream salesman:
    public class IcecreamSalesMan{
    }Our icecream salesman wants to sell icecreams, so lets give him a store. Lets say that each icecream store can only hold 3 icecreams. We could then define the IcecreamStore class as follows:
    public class IcecreamStore{
         Icecream icecream1;
         Icecream icecream2;
         Icecream icecream3;
    }Now lets modify our IcecreamSalesMan class to give the guy an icecream store:
    public class IcecreamSalesMan{
         IcecreamStore store = new IcecreamStore();
    }Ok, so now we have within our IcecreamSalesMan class a variable, called "store" which is itself an object (an instance) of the calss IcecreamStore.
    Now, as defined above, our IcecreamStore class will have three Icecream objects. Indirectly, our icecream salesman has now three icecreams, since he has an IcecreamStore object which in turn holds three Icecream objects.
    On the other hand, our good old salesman wants the three icecreams in his store to be chocolate, strawberry, and orange flavored. And he wants the two first icecreams to have chocolate chips, but not the third one. Well, here's the whole thing in java language:
    public class Icecream{ //define the Icecream class
         String flavor;
         boolean hasChocoChips;
    public class IcecreamStore{ //define the IcecreamStore class
         //Each icecream store will have three icecreams
         Icecream icecream1 = new Icecream(); //Create an Icecream object
         Icecream icecream2 = new Icecream(); //Create another Icecream object
         Icecream icecream3 = new Icecream(); //Create another Icecream object
    public class IcecreamSalesMan{ //this is our main (executable) class
         IcecreamStore store; //Our class has a variable which is an IcecreamStore object
         public void main(String args[]){
              store = new IcecreamStore(); //Create the store object (which itself will have 3 Icecream objects)
              /*Put the flavors and chocolate chips:*/
              store.icecream1.flavor = "Chocolate"; //Variable "flavor" of variable "icecream1" of variable "store"
              store.icecream2.flavor = "Strawberry"; //Variable "flavor" of variable "icecream2" of variable "store"
              store.icecream3.flavor = "Orange";
              store.icecream1.hasChocoChips = true;
              store.icecream2.hasChocoChips = true;
              store.icecream3.hasChocoChips = false;
    }And, retaking your original question, each of these three classes (Icecream, IcecreamStore, and IcecreamSalesMan) could be in a different .java file, and the program would work just fine. No need for packages!
    I'm sorry if you already knew all this and I just gave you a stupid lecture, but from your post I got the impression that you didn't have these concepts very clear. Otherwise, if you got the point, I'll let your extrapolate it to your own code. Should be a pice of cake!

  • Please Help with Simple Conversion

    I cannot figure out how to convert a String containing XML into a javax.xml.soap.SOAPElement. Could someone please advise?
    Thank you in advance.

         * Get SOAPMessage object from an InputStream and closes this stream.
         * @param soapStream InputStream with SOAP content.
         * @return SOAPMessage or null if failed.
         * @throws SOAPException
        public static SOAPMessage getMessage(InputStream soapStream) throws SOAPException {
            SOAPMessage result = null;
            if (soapStream != null) {
                StreamSource ss = null;
                try {
                    SOAPMessage message = SOAPUtils.createMessage();
                    SOAPPart part = message.getSOAPPart();
                    ss = new StreamSource(soapStream);
                    part.setContent(ss);
                    result = message;
                } finally {
                    try {soapStream.close(); } catch (IOException ioe) { ioe.printStackTrace(System.err); }
            return result;
        }//getMessage()
         * Convert a SOAPMessage in string format to a SOAPMessage object.
         * @param string String with SOAP content.
         * @return SOAPMessage or null if failed.
         * @throws Exception
        public static SOAPMessage toMessage(String string) throws SOAPException {
            SOAPMessage result = null;
            if (string != null) {
                result = getMessage(new ByteArrayInputStream(string.getBytes()));
            return result;
        }//toMessage()

  • HT5824 I switched over from an iPhone to a Samsung Galaxy S3 & I haven't been able to receive any text messages from iPhones. Please help with turning my iMessage completely off..

    I switched over from an iPhone to a Samsung Galaxy S3 & I haven't been able to receive any text messages from iPhones. I have no problem sending the text messages but I'm not receivng any from iPhones at all. It has been about a week now that I'm having this problem. I've already tried fixing it myself and I also went into the sprint store, they tried everything as well. My last option was to contact Apple directly. Please help with turning my iMessage completely off so that I can receive my texts.

    If you registered your iPhone with Apple using a support profile, try going to https://supportprofile.apple.com/MySupportProfile.do and unregistering it.  Also, try changing the password associated with the Apple ID that you were using for iMessage.

  • How can I sync my iPhone on a different computer without erasing my applications? My iPhone was earlier synced with a PC which I don't use anymore. Please help with proper steps, if any.

    How can I sync my iPhone on a different computer without erasing my applications? My iPhone was earlier synced with a PC which I don't use anymore.
    On the new computer, I am getting a message that my all purchases would be deleted if I sync it with new iTunes library.
    Please help with proper steps, if any.

    Also see... these 2 Links...
    Recovering your iTunes library from your iPod or iOS device
    https://discussions.apple.com/docs/DOC-3991
    Syncing to a New Computer...
    https://discussions.apple.com/docs/DOC-3141

  • Please help with "You can't open the application NovamediaDiskSupressor because PowerPC applications are no longer supported." I have seen other responses on this but am not a techie and would not know how to start with that solution.

    Please help with the message I am receving on startup ""You can't open the application NovamediaDiskSupressor because PowerPC applications are no longer supported."
    I have read some of the replies in the Apple Support Communities, but as I am no techie, I would have no idea how I would implement that solution.
    Please help with what I need to type, how, where, etc.
    Many thanks
    AppleSueIn HunterCreek

    I am afraid there is no solution.
    PowerPC refers to the processing chip used by Apple before they transferred to Intel chips. They are very different, and applications written only for PPC Macs cannot work on a Mac running Lion.
    You could contact the developers to see if they have an updated version in the pipeline.

  • Hi, please help with the installation of Lightroom 4, I bought a new Mac (Apple) and I want to install a software that I have on the album cd. My new computer does not have the drives. Can I download software from Adobe? Is my license number just to be ab

    Hi, please help with the installation of Lightroom 4, I bought a new Mac (Apple) and I want to install a software that I have on the album cd. My new computer does not have the drives. Can I download software from Adobe? Is my license number just to be able to download the srtony adobe.

    Adobe - Lightroom : For Macintosh
    Hal

  • [ETL]Could you please help with a problem accessing UML stereotype attributes ?

    Hi all,
    Could you please help with a problem accessing UML stereotype attributes and their values ?
    Here is the description :
    -I created a UML model with Papyrus tool and I applied MARTE profile to this UML model.
    -Then, I applied <<PaStep>> stereotype to an AcceptEventAction ( which is one of the element that I created in this model ), and set the extOpDemand property of the stereotype to 2.7 with Papyrus.
    -Now In the ETL file, I can find the stereotype property of extOpDemand as follows :
    s.attribute.selectOne(a|a.name="extOpDemand") , where s is a variable of type Stereotype.
    -However I can't access the value 2.7 of the extOpDemand attribute of the <<PaStep>> Stereotype. How do I do that ?
    Please help
    Thank you

    Hi Dimitris,
    Thank you , a minimal example is provided now.
    Version of the Epsilon that I am using is : ( Epsilon Core 1.2.0.201408251031 org.eclipse.epsilon.core.feature.feature.group Eclipse.org)
    Instructions for reproducing the problem :
    1-Run the uml2etl.etl transformation with the supplied launch configuration.
    2-Open lqn.model.
    There are two folders inside MinimalExample folder, the one which is called MinimalExample has 4 files, model.uml , lqn.model, uml2lqn.etl and MinimalExampleTransformation.launch.
    The other folder which is LQN has four files. (.project),LQN.emf,LQN.ecore and untitled.model which is an example model conforming to the LQN metamodel to see how the model looks like.
    Thank you
    Mana

  • Want a complete migration guide to upgrade 11.1.0.7 to 11.2.0.3 database using DBUA..We are implementing R12.1.3 version and then have to migrate the default 11gR1 database to 11.2.0.3 version. Please help with some step by step docs

    Want a complete migration guide to upgrade 11.1.0.7 to 11.2.0.3 database using DBUA..We are implementing R12.1.3 version and then have to migrate the default 11gR1 database to 11.2.0.3 version. Please help with some step by step docs

    Upgrade to 11.2.0.3 -- Interoperability Notes Oracle EBS R12 with Oracle Database 11gR2 (11.2.0.3) (Doc ID 1585578.1)
    Upgrade to 11.2.0.4 (latest 11gR2 patchset certified with R12) -- Interoperability Notes EBS 12.0 and 12.1 with Database 11gR2 (Doc ID 1058763.1)
    Thanks,
    Hussein

  • Welcome. At the outset, I'm sorry for my English :) Please help with configuration Photoshop CS6 appearance. How to disable the background of the program so you can see the desktop. (same menus and tools) Chiałbym to be the same effect as CS5.

    Welcome.
    At the outset, I'm sorry for my English
    Please help with configuration Photoshop CS6 appearance.
    How to disable the background of the program so you can see the desktop. (same menus and tools)
    i wantto be the same effect as CS5.

    Please try turning off
    Window > Application Frame

  • HT201210 cont contact apple server error please help with ipad touch 4. im just fed up with apple please help me because why is it only apple with these kind of problems?

    cont contact apple server error please help with ipad touch 4. im just fed up with apple please help me because why is it only apple with these kind of problems?

    If you mean updae server
    Update Server
    Try:
    - Powering off and then back on your router.
    - iTunes for Windows: iTunes cannot contact the iPhone, iPad, or iPod software update server
    - Change the DNS to either Google's or Open DNS servers
    Public DNS — Google Developers
    OpenDNS IP Addresses
    - For one user uninstalling/reinstalling iTunes resolved the problem
    - Try on another computer/network
    - Wait if it is an Apple problem
    Otherwise what server are you talking about

  • HT3209 Purchased DVD in US for Cdn viewing. Digital download will not work in Cda or US? please help with new Digital code that will work

    Purchased DVD in US for Cdn viewing. Digital download will not work in Cda or US? please help with new Digital code that will work

    You will need to contact the movie studio that produced the DVD and ask if they can issue you a new code valid for Canada. Apple cannot help you, and everyone here in these forums is just a fellow user.
    Regards.

Maybe you are looking for