Displaying a custom progress dialog

I have a Java app in which I want to display a custom non-modal progress dialog, but I cannot get it to display until all the work in the main thread is complete.
Basically, I want the following:
- User presses a button
- Progress dialog is displayed
- Work is performed
- Progress dialog is hidden
- Msg is displayed to the user
Right now, the progress dialog is shown but not fully painted until all the work is performed.
How can I get the dialog to display and be updated as the work progresses?
Note: I cannot use ProgressMonitor because it has a 'Cancel' button. The user is not allowed to cancel my long running task.
THANK YOU!

If you are doing a long task in the event thread then other events, such as redraws, will wait 'till the long task is completed.
Creating a thread is no big deal ...
Runnable job = new Runnable() {
  public void run() {
    doLongTask();
Thread t = new Thread(job);
t.start()Controlling thread interactions via wait() and notify() can get interesting, but Java doesn't make it needlessly complex.

Similar Messages

  • Reports crashes while displaying report progress dialog box

    Environment Description:
    Architecture: Cleint / Server
    Server:
    RDBMS: 8.0.5.1.0
    OS: Win NT
    Client:
    Win NT 4.0 Workstation, Service Pack 6
    Reports runtime 6.0.5.35.0
    Reports built with Reports builder 6.0.5.35.0
    Problem Description:
    My reports crashes while de 'Report Progress' dialog box is being displayed.
    Just before it crashes the dialog box shifts from the centre to the left of the screen and stops.
    Any help?

    Follow up:
    During the crash WinNT displays Dr. Watson saying:
    ...RWRBE60.exe Exception: divide by zero...
    Any help will be appreciated.

  • How to create a custom file dialog box/vi (win)??

    Hello,
    I'd like to create a custom file dialog box to handle the reading of my tdms files. Basicly I want to extend the existing file select dialog box with a graphical preview of the data in the selected file. I know I can create all the logic for file selection by hand and use a list box to display the filelist, but I would rather prefer to somehow use the existing windows controls. So is it possible to get the windows file selector on the front panel of a vi and react to the user selection? If so, is there any example available on how to do this? Any other options? I'm using labview 8.2
    thanks for your input!
    klaus

    Klaus,
    I wouldn't know that Microsoft provides access to the controls that Explorer and file dialog consist of.
    There might be a different and more powerful solution though. The
    WINDOWS Explorer / file dialog have a plugin API that allows you to
    associate your own application for thumbnail creation with a particular
    file extension. That way, TDMS thumbnails will show in any instance of
    Explorer and
    File Dialog without you having to make your own dialog. Basically, you
    would need to compile the VI that creates the thumbnail into a
    LabVIEW-built DLL and then wrap this DLL with some C++ boilerplate code
    that Microsoft provides. You might want to have a look at the bottom of
    this article to get an idea of how the whole thing works:
    http://msdn.microsoft.com/msdnmag/issues/0600/w2kui2/default.aspx.
    Hope that helps,
    Herbert

  • Displaying an Indeterminate Progress Bar While a DB2 Stored Proceedure Runs

    How do I display a dialog with an indeterminate progress bar while a DB2 query runs? Could anyone point me to an example or some strong docs?
    I learned Java about six months ago, so I'm relatively new to the language. Through searching and documentation, I've been able to find all the examples and answers I've needed so far. Now I've run into an issue I can't find anywhere. It seems like the most basic thing in the world. I have a DB2 stored procedure that takes about 5 minutes to run. While it's running, I want to display a simple dialog with a progress bar going back and forth (no buttons, no user interaction).
    I'm using Eclipse 3.3.1.1 as my IDE, and running the application from a JAR file. I have Java 1.6.0.30 installed. The DB2 query is running in response to a user clicking a button on the form (an ActionEvent). All of my forms are using Swing (JFrame, JDialog, etc.).
    The crux of my problem seems to be that I can bring up a dialog (which should contain the progress bar), but I can't get it to paint. All I get is a window that's the right size/location, but contains an after-image of what was behind it. I can't even get a dialog to display with a "Please Wait" label while the DB2 procedure runs.
    I tried separating both the DB2 stored procedure and the progress dialog into separate threads. I tried yielding in the DB2 thread to give the progress dialog a chance to update. I tried using invokeAndWait, but I got the following error:
    Exception in thread "AWT-EventQueue-0" java.lang.Error: Cannot call invokeAndWait from the event dispatcher thread
    It seems like I'm doing something wrong in my use of Theads, but I can't for the life of me figure out what it is. If anyone could help out a bit of a Java newbie, I would be extremely grateful.

    Demo:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class ProgressBarExample2 {
        private JProgressBar bar = new JProgressBar(0,99);
        private JButton button = new JButton("Lengthy operation");
        private ActionListener al = new ActionListener(){
           public void actionPerformed(ActionEvent evt) {
                button.setEnabled(false);
                bar.setIndeterminate(true);
                new Worker().execute();
        private class Worker extends SwingWorker<Boolean, Boolean>{
            protected Boolean doInBackground() {
                try {
                    Thread.sleep(10000); //10 secs
                } catch (InterruptedException e) {
                return Boolean.TRUE;
            protected void done() {
                button.setEnabled(true);
                bar.setIndeterminate(false);
        public static void main(String[] args) {
            EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new ProgressBarExample2();
        ProgressBarExample2() {
            button.addActionListener(al);
            JPanel cp = new JPanel();
            cp.add(button);
            cp.add(bar);
            JFrame f = new JFrame("ProgressBarExample2");
            f.setContentPane(cp);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.pack();
            f.setLocationRelativeTo(null);
            f.setVisible(true);
    }

  • Suppressing progress dialog when importing Tagged Text?

    Howdy:
    I'm using the Adobe Tagged Text import provider to place text in a document. I'm making the call to iImportProvider->ImportThis() with the kSuppressUI flag set. Even though the flag is set, InDesign is still displaying the progress dialog. Does anybody know how to keep that from happening? I don't see anything in the documentation about this.
    Thanks,
    Noel Williams

    Hello:
    I have the same problem that Noel.
    I'm using:
    * prov->ImportThis(database, stream, kSuppressUI, &contentUIDRef);
    * prov->ImportThis(database, stream, K2::kSuppressUI, &contentUIDRef);
    * prov->ImportThis(database, stream, (K2::UIFlags)0, &contentUIDRef);
    But the progress Dialog appears.
    This problem is critical for me.

  • Error generating custom progress

    Hi!
    When I run an application JavaFx in Firefox or IntenetExplorer displays the following message:
    Error generating custom progress : java.lang.SecurityException: attempted to open sandboxed jar http://dl.javafx.com/1.3/progressbar__V1.3.1_b101.jar as a Trusted-Library
    java.lang.SecurityException: attempted to open sandboxed jar http://dl.javafx.com/1.3/javafx-rt-windows-i586__V1.3.1_b101.jar as a Trusted-Library
         at com.sun.deploy.security.CPCallbackHandler$ParentElement.checkResource(Unknown Source)
         at com.sun.deploy.security.DeployURLClassPath$JarLoader.checkResource(Unknown Source)
         at com.sun.deploy.security.DeployURLClassPath$JarLoader.getResource(Unknown Source)
         at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
         at sun.plugin2.applet.JNLP2ClassLoader.findClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Excepción: java.lang.SecurityException: attempted to open sandboxed jar http://dl.javafx.com/1.3/javafx-rt-windows-i586__V1.3.1_b101.jar as a Trusted-Library
    The version of Java is 1.6.0_21
    Thanks for the help!

    Many of problems i've expienced with deployment where about jar signature and cache. Is that problem appear only with your APP, is it signed, there were many bug related issues with JDK u18 to 20.

  • Commands cause Fireworks 8 to freeze (with Batch Progress dialog)

    I've been having consistent trouble with Commands in Fireworks 8 (on Mac OS 10.4) causing the application to freeze. Has anyone else experienced this?
    Here's the scenario: I use custom keyboard shortcuts to trigger commands such as ‘Blend Mode - Forward’ or ‘Increase Brush Size’ in order to speed up my workflow. After executing several of these commands, I'll be doing something simple like using the Selection Tool or adjusting layer opacity, and the application will freeze. A Batch Progress dialog appears ("0 of 0 files processed. Batch conversion  complete."), but it is unresponsive. The only option is to Force Quit the application and to lose any unsaved changes.
    This happens quite frequently. It is not a problem with any particular command; it happens with _all_ commands.
    In trying to fix this bug, I discovered something interesting: Every time a command is executed in Fireworks 8, it generates an empty FireworksBatchLog.txt file within my User/Library/Application Support folder (the same folder where custom Keyboard Shortcuts and Library Symbols are stored). Normally, a Batch Log is written upon completion of a successful Batch Process, and it includes useful information about what files were processed and how. In this case, however, the Batch Log text file is empty.
    Now, this Batch Log might just be a symptom of the glitch, as opposed to the source itself, but it clearly connects with the Batch Progress dialog that appears once the application freezes. Apparently, when commands are executed rapidly via keyboard shortcuts, this empty Batch Log gets rewritten every single time, and a relatively innocuous problem compounds itself and causes the freeze.
    I reinstalled the software, but the bug persists. I've also filed a bug report with Adobe—but would they even consider _looking_ at a bug if the sofware version is this old? It seems odd that Fireworks 8 is the only version never to have received an update. And yet this bug seems very matter of fact. I'm quite surprised that I can't find any other references to it online...
    If anyone knows of a fix for this, or can replicate the bug in their version of Fireworks, please let me know.

    I've been having consistent trouble with Commands in Fireworks 8 (on Mac OS 10.4) causing the application to freeze. Has anyone else experienced this?
    Here's the scenario: I use custom keyboard shortcuts to trigger commands such as ‘Blend Mode - Forward’ or ‘Increase Brush Size’ in order to speed up my workflow. After executing several of these commands, I'll be doing something simple like using the Selection Tool or adjusting layer opacity, and the application will freeze. A Batch Progress dialog appears ("0 of 0 files processed. Batch conversion  complete."), but it is unresponsive. The only option is to Force Quit the application and to lose any unsaved changes.
    This happens quite frequently. It is not a problem with any particular command; it happens with _all_ commands.
    In trying to fix this bug, I discovered something interesting: Every time a command is executed in Fireworks 8, it generates an empty FireworksBatchLog.txt file within my User/Library/Application Support folder (the same folder where custom Keyboard Shortcuts and Library Symbols are stored). Normally, a Batch Log is written upon completion of a successful Batch Process, and it includes useful information about what files were processed and how. In this case, however, the Batch Log text file is empty.
    Now, this Batch Log might just be a symptom of the glitch, as opposed to the source itself, but it clearly connects with the Batch Progress dialog that appears once the application freezes. Apparently, when commands are executed rapidly via keyboard shortcuts, this empty Batch Log gets rewritten every single time, and a relatively innocuous problem compounds itself and causes the freeze.
    I reinstalled the software, but the bug persists. I've also filed a bug report with Adobe—but would they even consider _looking_ at a bug if the sofware version is this old? It seems odd that Fireworks 8 is the only version never to have received an update. And yet this bug seems very matter of fact. I'm quite surprised that I can't find any other references to it online...
    If anyone knows of a fix for this, or can replicate the bug in their version of Fireworks, please let me know.

  • Web-based BEx: How to display a customized message on the variable screen??

    Hi All,
    I'm now using the web-based BEx. Recently I want to display a customized message (e.g. the usage of the report) on the first page (i.e. the variable entry screen) of the query. Is it possible?
    Thanks.
    BR,
    M. Ng

    Hi marco,
          Check here. itmay help you.
    Custom Messages WAD
    Thanks,
    Vijay.

  • Customer number needed in "GL a/c line item display" for customer gl?

    Hi SAP Experts,
    while running GL account line item display in FBL3N,customer number is not displaying against the gl accounts relating to customer reconcilation account or the gls relating to the customer line item entry.my clients need that in either ASSIGNMENT field(where presently showing the document entry date as defult) or in a different column.for that he even does not want to write any report.
    How can i solve this problem?
    Plz guide me.
    I need a quick response.
    Regards,
    Biswa

    Hi,
    Check If you are using the G/L account which is the reconciliation account for your customer, then it is possible to display the special field1-U_KUNNR and it is ALSO possible to add Sort Key 031 into the Assignment field of that account in FS00 tab Control Data and therefore to display your 'Customer no.' in the Assigment field in FBL3N.
    If you are using the G/L account which is the offsetting entry or the other side of the posting, then it is NOT possible to display your 'Customer no.' neither in the Assignment field, nor adding the
    special field 1-U_KUNNR to the display. At this stage, notes 112312 and 217189 may be of use, which enable you to use a Business Transaction Event to populate offsetting account information.
    I hope these helps.
    Regards
    Ravinagh Boni

  • Problem with custom print dialog in Illustrator cs3 on OS X

    Hello Illustrator Support Forum,
    I am an IT systems administrator and I have a user that has a problem when printing from Illustrator to our Ricoh photocopier.  The problem is that Illustrator uses its own custom print dialog and not the default mac os x system one.  This prevents the print job from going through because it does not send the required user code along with the print job.
    A work around we found was to print to Adobe Distiller creating a pdf then printing from there but this definately not ideal.
    Any ideas?
    Thank you,
    - Vince

    Hi Larry,
    Thanks for the tip.  This makes it a bit easier of a work-around but its still not a fix for the initial problem of printing directly through Illustrator.

  • Using WE to display a custom box

    I have a report that I want the user to be able to sort or filter by clicking on a col header. When the user clicks on a col header, I want a small box to appear just below the col header with radio buttons to choose Asc or Desc and a drop-down list to choose a value to filter the col on.  I worked out the javascript for this in a text editor and it works (and I thought it was pretty cool). I've converted the javascript to Crystal Reports syntax and created some Webelements functions:
    This first one sets up the styles and js functions -
    // WEsortfilter
    // Add options to sort A/D and to filter on columne clicked
    // Pass in string of values from main rpt and sort ASC
    // When col header is clicked - display form with radio buttons and drop
    //      down list of values.
    //When sort is selected or member of list execute sort/filter.
    Function ()         
    '<STYLE type="text/css">'
    + '.Test{border-style:solid;border-width:1px;border-color:navy;'
    + 'position:absolute; z-index:66; background-color:lightblue;width:6cm;'
    + 'height:.83cm;padding-left:10px;padding-top:5px;font-family:Verdana;font-size:9pt;}'
    + '.sortlink{font-size:10;font-family:Verdana;color:blue;}'
    + '</STYLE>'
    //End of styles
    //Javascript  to call sort/filter box
    + '<SCRIPT LANGUAGE="JavaScript">'
    + 'function displaySortFilter(myid){'
    + 'var topObj=document.getElementById(myid).offsetTop;'
    + 'var leftObj=document.getElementById(myid).offsetLeft;'
    + 'var cdObj=document.getElementById("Test").style;'
    + 'cdObj.display="";'
    + 'cdObj.left=leftObj;'
    + 'cdObj.top=topObj+26;'
    + '}</SCRIPT>'   //End of function
    + '<form name="sortfilter">'
    + '<div ID="Test" NAME="Test" class="Test"'
    + 'STYLE="display:none">'
    + '<div id="divradio" STYLE="position:absolute">
    + '<input type=radio name=radio ID=radio value="asc">'
    + '<Span>ASC</Span>'
    + '<input type=radio name=radio ID=radio value="desc">'
    + '<Span>DESC</Span>'
    + '<SELECT NAME="filteroptions" ID="filteroptions" >'
    + '<OPTION VALUE="0" selected>Choose One<BR>'
    + '<OPTION Value="00">First<BR>'
    + '</SELECT>'+ '</div></div></form>'
    The second function creates a link for the user to click:
    //WEcallSortFilter
    Function ()
    '<A Style="text-decoration:underline" ID="sbu" class="sortlink" href="" onClick="'
    + 'displaySortFilter(this.id);return false">SBU</A>'
    The third one adds the style and js functionality to the report:
    //Display sortfilter custom function
    WhilePrintingRecords;
    WEsortfilter
    The last one adds the link to the report for the user
    //Call sortfilter custom function
    WhilePrintingRecords;
    WEcallSortFilter
    When I run this in the report through Infoview, the box pops up, however,
    1)     it doesn't show up right under the link clicked, but in the location where it was placed in Crystal Reports design view. It shows up like a static object instead of at the location clicked.
    2)     When the box displays, it is transparent. The other text on the rpt shows right through the box. I've tried changing the z-index to no avail. And no, making the box a solid color doesn't make it opaque. The other text showing through makes it difficult to click on any of the radio buttons.
    All this is beyond the WE examples, but I''ve to kick it up  a level (or three) to get this project done.
    Thanks

    hey, ran some tests on your scenario. to answer your questions...
    1) all of the functions are designed so that you don't have to make copies of them...all controls should be aok with being on a report more than once, as long as the element names are different...the ones that create on-click functionality (such as the collapsible section) require a different name for each control or you'll run into problems...the last iteration of the control on the report will be the only one that (sort of) works.
    that being said, i created 2 formulae and ran your code without any issues with a duplicate of the function.
    the only things that should cause something like this is
    (a) a control name starting with a number or containing certain non alpha-numeric characters...they follow the same rules as javascript...unfortunately this little tip was not in the user guide even though it was on the list (my fault, sorry) or
    (b) two control names that are the same or
    (c) a duplicate of the same formula on the report.
    2) another little tip that seemed to not make it into the user guide is to follow the same ordering principles on a report that you would with normal layering when designing a crystal report...i.e. right-click on objects in the designer and choose Format, then use the Move object action to bring the objects to the front.
    note that if there is a select menu below these controls you will not be able to have the collapsible section (or any other control) cover that select menu up...this is a known issue in internet explorer and there is no workaround for that one.
    hope that this helps,
    jw

  • Display the Customer/Vendor Name in the General Ledger Report

    **I have Questions about General Ledger Report in SAP Business One. How can Display the Customer/Vendor Name in the General Ledger Report.**
    *Just would like to ask if its possible to display the Customer/Vendor Name in the General Ledger Report? The format simply have the Customer/Vendor Code on the said report. Is there a work around on this?*

    If ur selection creteria by g/l account,u can display customer/vendor name by including
    offset account from form settings.

  • Display the Customer/Vendor Name in the Check Register Report

    Just would like to ask if its possible to display the Customer/Vendor Name in the Check Register Report? The format simply have the Customer/Vendor Code on the said report.  Is there a work around on this?
    Thanks...

    Llowen,
    You may develop a Query like this
    SELECT T0.CheckNum, T0.PmntNum, T0.VendorCode, T0.VendorName,  T0.TaxDate, T0.CreateDate, T0.PrnConfrm, T0.CHECKSUM FROM OCHO T0
    WHERE T0.Canceled = 'N' AND (T0.CheckDate BETWEEN  '[[%0]]' AND '[[%1]]') OR (T0.CheckNum BETWEEN '[[%2]]' AND '[[%3]]')
    Suda

  • T.code required for Vendor line item display and Customer line item display

    Hi Gurus,
    Pl provide me transaction code for "Vendor line item display and " Customer line item display apart from FBL1n for vendor and FBL5n for customers.
    Kindly advise.
    Regards,
    Samar

    Hi,
    You could use these, for example:
    S_ALR_87012103 - List of Vendor Line Items
    S_ALR_87012197 - List of Customer Line Items
    Just curious: what's wrong with FBL1(5)N?
    Regards,
    Eli

  • How Do You Display The Rendering Progress Bar In The Windows Dock?

    Is there a preference/setting in Windows that allows you to display a rendering progress bar on the the app icon in the dock for AE the way Premiere does?

    No.
    Mylenium

Maybe you are looking for

  • Data acquisition with highly accurate GPS time stamping (hh:mm:ss:sss UT)

    A research group has developed a data acquisition system dedicated to daily observations of solar phenomena at radio waves using high time resolution (5-100 ms). First, the analog signal from the antenna (1000-2500 MHz) is sent to a spectrum analyzer

  • How many apple tvs can i run at once

    i want to set up a trade show booth with apple tvs and a mac mini. how many apple tvs can i run off a mac mini? i want to run different slideshows.

  • Why "parent is null"?

    Hi guys, I'm developing a simple Applet application with JDK 1.3.1. All of codes are the following, DemoApplet.java public class DemoApplet extends Applet {   private static final long serialVersionUID = -371112038768840393;   public DemoApplet() {  

  • How do I hard wire multiple airport expresses with a switch

    I have two airport expresses and other hardwired devices.  I am trying to get them wired together for a roaming network not to extend the network, but can't seem to get it to work with a switch. Here is the setup Modem -> Airport Express -> 5 ports s

  • How does a RAC DB 'spread' from single instance to multiple instances ?

    GI/RDBMS Version: 11.2.0.3 OS: Oracle Linux 6.3 Filesystem : ASM When a RAC database is created using dbca , Manually , or RMAN restore, the DB is created in the Node1 first with cluster_Database=FALSE . Then you run the following commands (for 3-nod