Modal progress dialog

Hi all
I am having an interesting problem that hopefully some java guru can help me with. I would like to display a modal dialog while I do some database processing. The problem of course is that once you have shown the modal dialog, nothing can be done until it is disposed. Any ideas gratefully received.

One way to do this is to create a new thread to do your database processing. This thread can then update the progress bar as it executes.

Similar Messages

  • 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.

  • 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.

  • Problem with non modal ADM dialog

    I have problem with focus and mouse and keyboard event passing to non modal dialog if some modal window was opened and closed on Windows platform.
    I have this problem in my plugin, but also I did some tests with SDK WordFinder Plugin.There are 2 dialogs open there : CountDialog-non modal dialog and PromtDialog-modal one. I commented all lines in function DeleteCountDialog to leave this dialog on the screen. So, first, when "create page map" menu is selected, CountDialog is appearing and stays on the screen. At this stage, it can be moved and get focus when is clicked.After that, I click on "find word by word offset" and then PromtDialog is appearing. when I close Promtdialog by clicking on OK or Cancel, CountDialog is "freezing" - means, it can not be moved and does not get focus when I click on it.
    Is it known problem ? Is there is some workaround there ?
    thanks in advance,
    Lidia.

    Thanks a lot for your response.
    I did changes as you recommended, but still have the same result.
    So I have WordFinder from Acrobat SDK 8 with only one file changed:WordFinderDlg.cpp - see below.The result is the same:
    1. I open Acrobat->Open some file
    2. Click on "Advanced->Acrobat SDK->Word Finder->create Page Map" menu
    3. "count" non Modal Dialog is opened and working and then stays on the screen and can be moved without problem.
    4. Now I click on "Advanced->Acrobat SDK->Word Finder->find Word By Offset" - Modal Promt Dialog is opened. click some number and then click ok - choosen word is selected in Acrobat. From this moment, first "Count" dialog is frosen - can be selected, can not be moved.
    The only workaround I see here is to create non Modal dialog every time I close Modal one.
    Could you please advice ? May I please send to you project in zip ?
    I really need it ASAP ?
    thanks in advance,
    Lidia.
    ADOBE SYSTEMS INCORPORATED
    Copyright (C) 1994-2006 Adobe Systems Incorporated
    All rights reserved.
    NOTICE: Adobe permits you to use, modify, and distribute this file
    in accordance with the terms of the Adobe license agreement
    accompanying it. If you have received this file from a source other
    than Adobe, then your use, modification, or distribution of it
    requires the prior written permission of Adobe.
    \file WordFinderDlg.cpp
    - Implements a modeless progress dialog and a generic prompt dialog.
    // Acrobat headers
    #ifdef WIN_PLATFORM
    #include "PIHeaders.h"
    #endif
    #include "ADMAcroSDK.h"
    #include "resource.h"
    Constants/Declarations
    static ADMDialogRef countDialog;
    static AVWindow gAVWindow = NULL;
    // Global variables used for simplicity
    const ASInt32 MaxLen = 80;
    static char textStr[MaxLen];
    static char titleStr[MaxLen];
    static char msgStr[MaxLen];
    Modeless Progress Dialog
    /* UpdateCountDialog
    ** Updates the dialog with a new GUI function to show count number
    void UpdateCountDialog(ASInt32 cnt)
    ADMItemRef itemRef;
    itemRef = sADMDialog->GetItem(countDialog, IDC_COUNT);
    sADMItem->SetIntValue(itemRef, cnt);
    sADMDialog->Update(countDialog);
    /* CreateCountDialog
    /** GUI function to delete the count dialog
    void DeleteCountDialog(void)
    // destroy dialog
    /*if (countDialog) {
    sADMDialog->Destroy(countDialog);
    countDialog = NULL;
    // Release ADM
    ADMUtils::ReleaseADM();*/
    /* SettingsCountDialogOnInit
    ** Called to initialize the the dialog controls
    ASErr ASAPI CountDialogOnInit(ADMDialogRef dialogRef)
    ADMItemRef itemRef;
    itemRef = sADMDialog->GetItem(dialogRef, IDC_COUNT);
    sADMItem->SetUnits(itemRef, kADMNoUnits);
    sADMItem->SetIntValue(itemRef, 0);
    return kSPNoError;
    /* CreateCountDialog
    ** Creates the modeless dialog.
    void CreateCountDialog(void)
    // Initialize ADM.
    ADMUtils::InitializeADM();
    // Display modeless dialog.
    countDialog = sADMDialog->Create(sADMPluginRef, "ADBE:Wordfinder", IDD_COUNT_DIALOG,
    kADMNoCloseFloatingDialogStyle, CountDialogOnInit, NULL, NULL);
    Generic Prompt Dialog
    /* PromptOnOK
    ** Called when the user clicks OK. Stores the string entered by the
    ** user.
    static void ASAPI PromptOnOK(ADMItemRef item, ADMNotifierRef inNotifier )
    sADMItem->DefaultNotify(item, inNotifier);
    // get user input string
    ADMDialogRef dialog = sADMItem->GetDialog(item);
    ADMItemRef item1 = sADMDialog->GetItem(dialog, ID_PROMPT_FIELD);
    sADMItem->GetText(item1, textStr, MaxLen);
    sADMDialog->EndModal(dialog,IDOK,FALSE);
    AVAppEndModal();
    AVWindowDestroy(gAVWindow);
    /* PromptDialogOnInit
    ** Called to initialize the dialog controls.
    ASErr ASAPI PromptDialogOnInit(ADMDialogRef dialogRef)
    gAVWindow = AVWindowNewFromPlatformThing (AVWLmodal, AVWIN_WANTSKEY, NULL, gExtensionID, sADMDialog->GetWindowRef(dialogRef));
    AVAppBeginModal (gAVWindow);
    sADMDialog->SetText(dialogRef, titleStr);
    sADMDialog->SetDefaultItemID(dialogRef, IDOK);
    sADMDialog->SetCancelItemID(dialogRef, IDCANCEL);
    ADMItemRef itemRef;
    itemRef = sADMDialog->GetItem(dialogRef, IDOK);
    sADMItem->SetNotifyProc(itemRef, PromptOnOK);
    itemRef = sADMDialog->GetItem(dialogRef, ID_PROMPT_FIELD);
    sADMItem->SetUnits(itemRef, kADMNoUnits);
    sADMItem->SetMinIntValue(itemRef, 1);
    itemRef = sADMDialog->GetItem(dialogRef, ID_PROMPT_NAME);
    sADMItem->SetText(itemRef, msgStr);
    return kSPNoError;
    /* PromptForInfo
    /** Generic prompt dialog that gets a text string from the user.
    /** @return IDOK or IDCANCEL.
    ASInt32 PromptForInfo(const char *title, const char *msg, char *buf, ASInt32 bufLen)
    if (!buf || (bufLen == 0))
    ASRaise (GenError(genErrBadParm));
    // Initialize ADM.
    ADMUtils::InitializeADM();
    // init data
    buf[0] = 0;
    strncpy(titleStr, title, sizeof(titleStr) - 1);
    strncpy(msgStr, msg, sizeof(msgStr) - 1);
    // Dispaly modal dialog to get user input
    ASInt32 rc = sADMDialog->Modal(sADMPluginRef, "ADBE:Wordfinder", IDD_PROMPT_DIALOG,
    kADMModalDialogStyle, PromptDialogOnInit, NULL, NULL);
    // get user input data
    if (rc==IDOK)
    strcpy(buf, textStr);
    // Release ADM
    ADMUtils::ReleaseADM();
    return rc;

  • 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.

  • 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.

  • Print Progress Dialog box always stays on top

    Since upgrading to InDesign CC I have noticed that all print progress dialog boxes stay on top of all windows, even after switching apps. I find this highly annoying and want it to go away. Is there a preference I can change to make it NOT be on top, especially when I've switched to a different application?

    (I am OP, having account issues)
    Trashing preferences wouldn't help if it is a default behavior, which I think this is since it's been happening since the beginning with CC. I was wondering if this was a behavior that I can change with a preference or if I'm just stuck with it.

  • Non-Modal SUD Dialog Possible?

    Is it possible to have a non-modal SUD dialog box?  I would like to use a SUD dialog box to show some things going on while a script is running, and would like it to operate much like a non-modal message box. 
    Thanks!  Julia

    Thank you for your reply, I was hoping to display a table (with changing values) or some images while scripts were executing, but I will be content with the non-modal MsgBoxDisp dialog boxes 

  • Progress dialogs for (eager and lazy) downloads

    <resources progress="all-downloads">
    </resources>
    Where 'progress' values are
    "standard" - default behaviour if omitted - progress
       dialog for eager downloads only
    "all-downloads" - progress dialog supplied for all
       downloads, eager or lazy.
    "none" - (suggest) no progress dialogsThe 'progress' attribute is not something in the
    web start API, but I would like to see it added.
    The intent is to allow the JNLP file to suggest a
    behaviour for progress dialogs during the download
    of both eager and lazy resources.
    Currently (web start in 1.5), there is no progress
    dialog, or message of any kind, during the download
    of 'lazy' resources.
    My questions.
    Is it technically feasible to provide this ability?
    Does it conform to the web start ..framework?
    Would an RFE to add support for this 'progress'
    attribute (call it what you like) be well received
    (or disappear into the abyss as some other
    requests assigned an ..'internal review ID'
    sometimes seem to)?
    More generally to other forum members, is
    this something that is important to you?
    Would you vote for an RFE to support the
    progress dialog attribute?

    ScheduleWorld used to use around 40 jars and I noticed a big speedup when I started using the version protocol. Now, my httpd logs only report a HTTP HEAD request on the jnlp file (sometimes icon image too?) and the app starts quite fast. I use less jars now but I am sure the main thing is the switch to the version protocol.
    With the version protocol, the client can determine if it has all of the right versions without making network connections. If you have a slow network connection (like a modem) and/or your server has keepalive disabled and is rate-limited to the number of new connections/second to the same IP you could see exactly what you are describing.

  • 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.

  • PS cc leaves a "Progress" dialog hanging

    Running PS cc up to date (current) on windows 7 64 bit (current)
    The new PS cc seems to leave a blank progress dialog box open and maybe orphaned or something in this scenario:
    Doing Focus Stacking, with 6 images on layers and after running:
    Edit/ auto align layers
    --- followed by
    Edit/ auto blend layers 
    The dialog box shown in the attached image lingers seemingly until I close it.
    I allowed it to linger for over 1/2 hr. 

    Running PS cc up to date (current) on windows 7 64 bit (current)
    The new PS cc seems to leave a blank progress dialog box open and maybe orphaned or something in this scenario:
    Doing Focus Stacking, with 6 images on layers and after running:
    Edit/ auto align layers
    --- followed by
    Edit/ auto blend layers 
    The dialog box shown in the attached image lingers seemingly until I close it.
    I allowed it to linger for over 1/2 hr. 

  • Progress dialog sometimes stays open

    Hi,
    I have a problem that my progressDialog bar sometimes, very rarely mind you, stays open even though it should be finished if I run my GUI application in UNIX, it does not appear to happen in Windows. Has anyone else experienced this or have any idea from the code pasted below why it might be happening.
    thanks in advance,
    a
    * ProgressDialogController
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import javax.swing.*;
    public class ProgressDialogController extends AbstractDialogController
    implements ActionListener {
    private ProgressDialogView view;
    private ProgressUpdater progressUpdater = new ProgressUpdater();
    private IProgressDialogCallBack ipdcbListener = null;
    private boolean bCancelButtonNeeded = true;
    public ProgressDialogController( RequestHandler requestHandler, boolean bCancelButtonNeeded ) {
    this.ipdcbListener = requestHandler;
    this.bCancelButtonNeeded = bCancelButtonNeeded;
    protected void init() {
    view = (ProgressDialogView)getView();
    view.messageText.setText( "" );
    if ( bCancelButtonNeeded ) {
    view.addCancelButton();
    view.cancelButton.addActionListener(this);
    Timer timer = new Timer(500, progressUpdater);
    timer.setRepeats(true);
    timer.start();
    protected void viewClosing() {
    ipdcbListener.respondToCancelEvent();
    protected void stop() {
    // dialog is closing so can't retrieve
    // any updates anymore
    ipdcbListener = null;
    if ( bCancelButtonNeeded ) {
    view.cancelButton.removeActionListener(this);
    view = null;
    progressUpdater = null;
    public void actionPerformed(ActionEvent event) {
    // it may take some time to finish
    // current job, so we desable cancel button
    // but wait till dialog will be shut down
    // by its owner
    if ( bCancelButtonNeeded ) {
    view.cancelButton.setEnabled( false );
    // notify owner about cancel request
    ipdcbListener.respondToCancelEvent();
    public void updateMessageOnProgressDialog( String strMessage ) {
    if ( view!=null ) {
    if ( view.messageText != null ) {
    view.messageText.setText( strMessage );
    private class ProgressUpdater implements ActionListener {
    private int progress;
    public void actionPerformed (ActionEvent e) {
    if (view != null) {
    progress = progress + 20;
    if (progress > 100) progress = 0;
    view.progressBar.setValue(progress);

    When you post code, please use [code] and [/code] tags as described in Formatting Help on the message entry page. It makes it much easier to read.

  • Create Modal Preferences Dialog

    I have a program that I want to add a Preferences Dialog to so if the user clicks Preferences, a Modal dialog opens. Then after the user clicks OK on the modal dialog, I want to retrieve all the updated values and if the user clicks Cancel, do not grab the changes the user may have made. I am having problems trying to figure out how to do this? I originally thought I should create a new JFrame and create my window like any other JFrames. But I discovered it is very difficult to try and make the JFrame modal. The easiest way seems to be to use a JDialog, but how can I create my own GUI for the JDialog? I have searched for examples and cannot find any. I must be using bad search terms or something. Thanks for all your help!

    CeciNEstPasUnProgrammeur wrote:
    Do what exactly? Did you try listeners?So when I have the 2 buttons in the dialog, how do I connect the listeners to the parent window? Since I will create the JPanel in another class, the parent class won't know about the OK and Cancel buttons to know how to add listeners. I know in Qt with C++, you can connect signals to slots, but what listeners would you do this with for the buttons?
    It's no different from creating an JFrame. It's a dialog with a content pane that you can fill.
    Aaaaargh! The API docs even link to the "how to make dialogs" tutorial. Reading them is too difficult I suppose.No, you suppose wrong, reading the tutorials is not too difficult, I just missed the bit where it showed you can set the content pane of the JDialog just like you can with the JFrame. So sorry I just missed this in the tutorial, most of it seemed how to create nice little convenience dialogs and not custom dialogs, Thanks!

  • Modal INLINE dialog windows

    Hello,
    I'm facing some issues with the modal dialog windows that are embedded in an window and are not opened as a separate window. I saw the "tutorials" in different weblogs and the book of Jung/McKellar for the "F4-Help". It works well unless I integrate it into the portal. There, I do have two issues:
    1. It looks much different as if I would open it directly from the backened system. The close/maximize buttons are different and the ok button at the botton is on the right side and not on the left side. It's not tragical but I'm asking why.
    2. It's only possible to open ist once. If I open it the second time I dont see any buttons like maximizing etc.
    I really hope anyone of you can help me. It's a great feature and I would appreciate any help and reward point therefore.
    thanks and regards
    Markus Armbruster

    hi
    good
    go through this link,might give you some solution
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCDWBERG/BCDWBERG.pdf
    http://www1.sapdesignguild.org/resources/ma_guidelines_2/ma_guidelines_2.pdf
    thanks
    mrutyun^

  • Crystal Reports for Visual Studio 2010 (CRVS2010) - Progress Dialog

    Hello,
    What is the meaning behind the Progress Animation? It seems to be an asynchronous control that spins while the report is being generated. What would cause the animation to stop or freeze for 10seconds or so then start back up?
    CrystalDecisions.Windows.Forms.CrystalReportViewer.ShowProgressAnimation(bool);
    In the Crystal 11 ActiveX Windows control, it had a start and stop downloading event which allowed our company to create a progress controls based on those events. These events were removed in the .Net version. Has there been any conversion about adding a progress bar, progress information, and/or progress events to the .Net version of the crystal viewer? Users can see this information from the status bar within Crystal Designer but not within the crystal viewer.
    Thanks much!
    TP

    Yes, there have been discussions and the animation you see is the result. No further enhancements are planned. Having said that, I have not seen the behavior you describe, nor do I recollect anyone reporting the issue on these forums or through phone support. At this time, all I can recommend is to make sure you're on SP 2 for CRVS2010 (see the sticky thread at the top of this forum).
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

Maybe you are looking for