How to make JDialog show progress?

First of all, yes, I used the search function and I know this problem is all over the board, but as so often, the topics I found don't answer my question.
The Mission: So I want to show my program's user the progress of a function with a progress bar displayed in a custom JDialog along with some other information.
The Solution?: After hours of searching and trying, I stumpled upon http://www.javareference.com/jrexamples/viewexample.jsp?id=77 , which actually works. Problem is, when I try to build it into my app, it doesn't work anymore.
The Problem: So what did I do? First, I put the create dialog and perform computation stuff from the example into a function "progressFunction" instead of doing it right away in the main function. Then I wrote a JFrame that has a button. JFrame knows the programs core class with the main function and progressFunction. Clicking on the button calls the progressFunction from the core class. Function gets executed, JDialog shows, but without its contents, namely a progress bar to show the progress of the function.
The plea for help: As far as I understand, this problem should be solved by putting the execution of the JDialog into a seperate thread, as it is done in the example.
So, does anyone have a clue why this works directly from the programs main function, but not if I take an indirect approach over user interaction with the gui that calls the function?

Thanks for your replies.
I knew already about the tutorial, but I need a custom progress JDialog, JProgressMonitor doesn't fulfill my needs.
bsampieri, your answer got me to the solution, but not directly. First of all, I already tried invokeLater(), doesn't work for me.
invokeAndWait() on the other hand can't be called from the EDT, but doing some searching on it got me to the following code: http://www.cs.helsinki.fi/u/vihavain/k03/Java/CoreJavaVolIICh1/ProgressMonitorTestjava.html
which solves my problem. I guess the trick here is the timer that monitors the actual activity. Seems the timer can force the gui to update, while my custom Thread can't.
CU
FLo

Similar Messages

  • Hi all, how to make slide show on Iweb with out QuickTime?

    Hi all, how to make slide show on Iweb (with out QuickTime or link to YouTube) to be watched in any computer/system?
    I used Imove - share - exported - medium (m4v)
    This the one I did.
    http://360motorcycleadventures.com
    Must looking profissional (no YouTube frame)
    The problem is: I lot people don't have QuickTime, any body can point me the right direction?
    Thanks' in Advance.

    I use this slideshow often :
    http://www.wyodor.net/iWebBlogTest/Wyodor_1/WebBanner.html
    See it here in an iWeb page :
    http://www.wyodor.net/_Demo/MyHouse/Huis.html
    These are the slideshows :
    http://www.wyodor.net/_Demo/Gardens/flagstones.html
    http://www.wyodor.net/_Demo/Gardens/gardens.html
    And here in a non-iWeb page :
    http://www.wyodor.net/htmlegg/SmallCard/SmallSlideshow.html
    This is the slideshow itself :
    http://www.wyodor.net/htmlegg/SmallCard/VintageParis/
    Or use WOW slider :
    http://www.wyodor.net/htmlegg/TallCard/TallWow.html
    There are lots of slideshows out there. Choose the one you like.
    And search/browse this forum for other solutions.

  • How to make JDialog can't be moved ... ?

    Hi, all ...
    I'm currently build an application with a Swing. I'm using JDialog right now. Is there anyone know how to make JDialog can't be moved ... ? I want my JDialog stay in center, and nobody can't move it ...
    Thanks before ...

    Good problem!
    If you use the JDK 1.4, there are some method to work for this problem
    You should not use the native windows decode title bar, see the
    Frame.setUndecorated
    JRootPane.setWindowDecorationStyle(JRootPane.FRAME)It seems that you should create a BasicRootPane subclass and implements
    your title bar.

  • HOW TO MAKE AUDIO SHOW THE SOUND WAVES?

    I was wondering if it was possible to show the sound waves on the audio track, whenever I plug in audio I cant seem to figure out how to make it show like it does in other programs such as Adobe Premiere? Thanks!

    Option-Command-W, if you're the keyboard type
    Otherwise, there's button right by the track height selector buttons, at the bottom left of the Timeline.

  • My subscribed calendar does not display in today view in iOS7. Does anyone know how to make it show up?

    I have a subscribed calendar on my iPhone. The today view in notification center shows that I have an event at xxxx and tomorrow view says I have x events but the calendar day view does not display any of the events. I need this so I can easily see which rooms my events are in. Dows anyone know how to make the subscribed calendar show up in calendar day view?

    Interesting. May have uncovered a bug. It seems that limited duration events will display, but all day events wont on mine. (iPhone 5). Does that compare to what you are seeing (unfortunately, I have nothing in a subscribed calendar until the week end, so difficult to check. I do seem to recall seeing an event from one this past week end on the iPad, however).

  • How to make "SQLPLUS" show me the Brazilian accented characters correctly?

    Hi,
    I have a Oracle9i instance, with this configurations.
    PARAMETER VALUE
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    NLS_CHARACTERSET WE8MSWIN1252
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY $
    NLS_COMP BINARY
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CONV_EXCP FALSE
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_RDBMS_VERSION 9.2.0.1.0
    I have a xHarbour DOS Client program that reads, shows in the screen, and write "perfectly fine" a text with Brazilian accentuation stored in a CLOB field.
    Following you can see the sample of the text with Brazilian accentuation in my DOS application http://www.screencast.com/t/U5PXwCEo8
    In order to my xHarbour DOS Client program works fine with this Brazilian accented characters, I must to set:
    SET NLS_LANG=PORTUGUESE_BRAZIL.WE8MSWIN1252
    And all is OK from my xHarbour DOS Client program.
    My problem is because when I query this data manually using a SELECT from any client DOS/WINDOWS program like SQLPLUS, SQLDEVELOPER, TOAD, etc, I get bad characters instead the correct Brazilian accented characters.
    Following you can see the same text into the Toad http://www.screencast.com/t/A1tal2Rtg
    (you will see bad characters instead the correct Brazilian accented characters).
    Following you can see the result of querying this field using a SELECT from SQLPLUS.
    Certifico que por decis„o proferida no processo n§ @@@@@@@@@@@@@@, 
    foi reconhecida a n„o incidˆncia do ITBI na transa‡„o do(s) im¢vel(is) 
    abaixo caracterizado(s), com base no art.156, @ 2§, I, da Constitui‡„o 
    Federal de 1988 e no art.6§, II, da Lei Municipal n§ 1.364 de 19/12/1988. 
    (you will see bad characters instead the correct Brazilian accented characters).
    How to make "SQLPLUS", "TOAD" (and others Windows or DOS Clients programs) show me the Brazilian accented characters correctly?
    Thanks in advance,
    Luigggye
    Edited by: 880676 on Jul 20, 2012 9:08 PM

    This is a duplicate thread. See the answers at Re: How to change the NLS_NCHAR_CHARACTERSET from WE8ISO8859P1 to AL16UTF16 ?

  • How to make attachments "show" when sending mail?

    Hello
    How can I make sure that when I add attachments to my mail it would show in the body of the mail on the receivers end,
    regardless of what mailprovider or program he/she is using. (e.g. a pdf file)
    Any clues?

    If you make sure your message is in rich text (Format -> Make Rich Text, if it says Make Plain Text it's already rich text) and make sure that you're sending Windows-friendly attachments (Edit -> Attachments), that will increase the chances. But there is *no way* to guarantee that an attachment will be displayed inline at all, since different mail clients work differently and different people have different settings... many people prefer plain text e-mails, and there is nothing you can do about that.

  • How to make tabs show up selectively in different pages?

    Hi,
    I'm new to APEX and getting my hands dirty now...
    I have a standard Tab Set called "TS1", which has 2 tabs (say, tab1 and tab2) in there. Since tabs are under "shared component", so it appears that they are shared throughout all the 10 pages I have.
    How can I make the tabs show up selectively in different pages? For example, I want tab1 and tab2 showing up in page1-9, but NOT in page10. There's a "conditions" (Condition Type), but it has many types and I don't know how to use it.
    Please kindly help!
    Thanks much,
    Helen

    I have a similar requirement. I have several tabs (Operations, Maintenance, Safety, etc.) and users get individually assigned rights. I have a table where I have all the users listed and I added one column for each tab so I can set whether or not that user has access to that tab. You could go the same thing with groups if you want.
    Basically, my table looks like this:
    USER_ID, USER_NM, PWD_HASH, SAFETY_TAB, MAINT_TAB, OPER_TAB, etc.
    where each of the _TAB fields is set up as a VARCHAR2(2) for just Y/N.
    On my home page, I assign an APPLICATION_ITEM called G_USER_ID (Global User ID) on login so I can track who it is. Then I set the condition statement on the tab to SQL QUERY RETURNS AT LEAST ONE ROW
    using the following query:
    select SAFETY_TAB from APEX_USERS
    where SAFETY_TAB = 'Y'
      and USER_ID = :G_USER_IDThis example would be for the Safety tab, but you can easily substitute others. It works pretty slick.

  • How to make list show up "selectively" on different regions?

    Hi,
    By default, "list" is in the Shared Component.
    Is there any way I can make the "list" NOT shared? Meaning that I want to control which "regions" the particular "lists" will show up or not.
    For example:
    On my APEX Home page, I want to have 5 Forms (Form1-From5) for the user to select from. And each Form contains 3 sub-forms: New Entry, Update and Delete.
    So on the Home page, I defined 5 regions (for Form1 - From5), and within each region, I have 3 "lists" for New Entry, Update and Delete and in turn each list calls appropriate form to perform "New Entry", "Update" or "Delete" accordingly. It looks something like the following:
    Form1
    Form1NewEntry Form1Update Form1Delete
    Form2
    Form2NewEntry Form2Update Form2Delete
    and so forth.
    However, since the "list" is shared components, whatever lists that I define in Form1 show up THROUGHOUT ALL 5 forms, that is "Form1NewEntry" and "Form1Update" and "Form1Delete", which is NOT what I want. Is there a way I can use "Condition" to make the "lists" show up in "region" (NOT page) selectively? And how (since there are MANY options in the "Conditions")?
    Or if not, could you suggest the alternative way of doing it? (ie: Form1 -> subformNewEntry
    -> subformUpdate
    -> subformDelete)
    I have an important demo coming up shortly. And this is our FIRST Apex application in the company to show its usability.
    Greatly appreciated,
    Helen

    I have a similar requirement. I have several tabs (Operations, Maintenance, Safety, etc.) and users get individually assigned rights. I have a table where I have all the users listed and I added one column for each tab so I can set whether or not that user has access to that tab. You could go the same thing with groups if you want.
    Basically, my table looks like this:
    USER_ID, USER_NM, PWD_HASH, SAFETY_TAB, MAINT_TAB, OPER_TAB, etc.
    where each of the _TAB fields is set up as a VARCHAR2(2) for just Y/N.
    On my home page, I assign an APPLICATION_ITEM called G_USER_ID (Global User ID) on login so I can track who it is. Then I set the condition statement on the tab to SQL QUERY RETURNS AT LEAST ONE ROW
    using the following query:
    select SAFETY_TAB from APEX_USERS
    where SAFETY_TAB = 'Y'
      and USER_ID = :G_USER_IDThis example would be for the Safety tab, but you can easily substitute others. It works pretty slick.

  • How to make slide show out of photos

    I have about 60 .jpg's I like to make into a slide presentation. What I would like to be able to do is give a friend/relative a disk and all they would have to do it....well, nothing. I'd like it to open on my image number 1. I would like the image to stay on the screen until it's manually advanced by "clicking" on it or on and "advance" button. It seems like it should probably be easy, but I can't figure it out. I'm not adverse to using third party software. I want the images to be as clear as possible. Am using OS X Maverick with 32 GB of ram.
    Thanks in advance.

    There are many ways to produce slide shows using iPhoto (see this:  http://support.apple.com/kb/PH2423 ), iMovie or iDVD and some limit the number of photos you can use (iDVD has a 99 chapter (slide) limitation).
    If what you want is what I want, namely to be able to use high resolution photos (even 300 dpi tiff files), to pan and zoom individual photos, use a variety of transitions, to add and edit music or commentary, place text exactly where you want it, and to end up with a DVD that looks good on both your Mac and a TV - in other words end up with and end result that does not look like an old fashioned slide show from a projector - you may be interested in how I do it. You don't have to do it my way, but the following may be food for thought!
    Firstly you need proper software to assemble the photos, decide on the duration of each, the transitions you want to use, and how to pan and zoom individual photos where required, and add proper titles. For this I use Photo to Movie. You can read about what it can do on their website:
    http://www.lqgraphics.com/software/phototomovie.php
    (Other users here use the alternative FotoMagico:  http://www.boinx.com/fotomagico/homevspro/ which you may prefer - I have no experience with it.)
    Neither of these are freeware, but are worth the investment if you are going to do a lot of slide shows. Read about them in detail, then decide which one you feel is best suited to your needs.
    Once you have timed and arranged and manipulated the photos to your liking in Photo to Movie, it exports the file to iMovie  as a DV stream. You can add music in Photo to Movie, but I prefer doing this in iMovie where it is easier to edit. You can now further edit the slide show in iMovie just as you would a movie, including adding other video clips, then send it to iDVD 7, or Toast,  for burning.
    You will be pleasantly surprised at how professional the results can be!
    To simply create a slide show in iDVD 7 onwards from images in iPhoto or stored in other places on your hard disk or a connected server, look here:
    http://support.apple.com/kb/HT1089
    Preparing images for iDVD slideshows:
    http://support.apple.com/kb/PH5452

  • How to make use of *progress bar*?

    I have a progress bar requirement in my swings project,
    i.e on clicking a button, some task should be executed and in parallel to this
    progress should run on progress bar in the same frame and soon after this task
    gets completed the progress on progress bar should come to an end.
    How can i do this in swings?
    could any one help me out from this?

    How to use progress bar
    http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html
    If you want an example scroll down to the bottom of the page and download the examples.

  • How to make iphone show up in windows explorer?

    i know with my ipod theres a option to make the ipod a device to store data too but i cant seem to find the option on the iphone, is there a way for it to show up in windows explorer

    There is not. You can't use the iPhone in disk mode like the iPod.

  • How to make links show images?

    Today I was playing with Trinity Rescue Kit and links in this CD shows images from web. How to do that?

    Err, I'm talking about links: http://en.wikipedia.org/wiki/Links_%28web_browser%29

  • How to Make a "show hidden items" script in Automator

    I would like to make an Automator application that i can launch to show hiddden files, then another one to launch to hide them again. I tried using the shell script option, with this in it:
    defaults write com.apple.Finder AppleShowAllFiles TRUE
    then I typed this in the next box:
    killall Dock
    It only killalled the dock, no hidden items shown.

    Simpler to just create an AppleScript application, put it onto the Dock, and then just click on it. It's a toggle: unhides on one click and hides on another. This is what I use:
    try
              do shell script "defaults read com.apple.finder AppleShowAllFiles"
    on error
              do shell script "defaults write com.apple.finder AppleShowAllFiles 0"
    end try
    if (do shell script "defaults read com.apple.finder AppleShowAllFiles") is equal to "0" then
              do shell script "defaults write com.apple.finder AppleShowAllFiles 1"
    else
              do shell script "defaults write com.apple.finder AppleShowAllFiles 0"
    end if
    do shell script "killall Finder"

  • How to make mail show a message accurately?

    I recently upgraded to OS X 10.9.
    Now, when I open a message in Mail, it is doing two things that are creating significant difficulty for me:
    1. It is grabbing other, unrelated messages, and showing them as though they are part of the message I clicked on, even though they are not.
    2. It is supressing messages that are part of the thread of the message I clicked on.
    I have never experienced behavior like this with Mail from the older operating systems.
    Is there any way to cause Mail in OS X 10.9 to behave like a normal email client? By this, I mean:
    1. When I click on a message, it shows me the message I clicked on, and
    2. The content of the message contains the actual content of the message (i.e. nothing is taken away, nothing is supressed), and
    3. The message reflects the actual message, and does not include any other messages added into it by Apple which were never part of the message
    Is this possible?
    I have tried the following:
    Mail, Preferences, Viewing
    - Use classic layout
    - Unchecked "include related messages"
    I can't find any other setting that seems relevant to this behavior.

    I can get my mail to go full screen if i hold it 'portrait' (tall way up instead of short and wide). click on a message and it fills the whole screen.

Maybe you are looking for

  • Error message when attempting to open iTunes

    Hi everyone, I had an outdated version of iTunes installed and I tried to update it for the newest version, but I had lots of problems regarding disk space so I installed the earlier version again to try and reverse what I'd done. Now, all my music i

  • Unable for last 4 days to send or receive mobile.me emails

    Unable to send or receive mobile.me e mails on iPhone for 4 days. Error message states password or settings incorrect. Password is fine as can log into mobileme.com with no issue. I have not amended settings whatsoever.Cannot get to Genius bar until

  • AS2 asnyc MDN not working

    Hi, I have setup my config in SeeBurger AS2 adapter in SAP PI 7.11 to send a file to our trading partner via AS2-HTTPS with async MDN requested. I got the an error in seeburger message monitoring : "Sent AS2 message successfully to partner - waiting

  • 12- inch Powerbook

    Just bought PB 12- inch and while I'm trying to work the internet connection my scrreen turned into this weird display. Too much contrast. Tried to fix it thru Apple Tech support and they cannot give me a solution. Can anybody help me.

  • Automatic inclusion in the Library

    Is there a way to play songs in iTunes without having them automatically included in the libraries? It's more of an annoyance, but it would be nice to be prompted on whether to include the song in the library. The problem is that I don't want all the