Swing Dialog not Showing Content

Hello,
I am currently developing code for a complex GUI system and I am experiencing a big problem
when I try to popup JDialogs. I have a JProgressBar inside a JDialog that pops up when our
system is doing work. The JDialog pops up but I cannot see the JProgressBar inside the dialog.
(I also tried to just add a JLabel to the dialog but that doesnt show up either.) When I run my progress
dialog "stand-alone" I can see the progress bar fine.
The code for my progress dialog even creates its own thread when it runs so I am pretty sure that
its not blocking inside my own code.
This leads me to believe that somewhere in our GUI code we have somehow "blocked" some critical
AWT (or Swing?) thread and it cannot update the contents of the JDialog.
Does anyone have an idea as to what could be going on here or how I might find out? I have tried using
JProbe and Optimizeit Thread profiling tools but they have not really been much help.
Thanks!
M.
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Point;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JProgressBar;
import javax.swing.SwingConstants;
public class ProgressAnimationDialog implements Runnable {
     private static final Dimension DIALOGSIZE = new Dimension(200,100);
     private JDialog theDialog;
     private JProgressBar progressBar = new JProgressBar();
     private String string = null;
     private Component owner = null;
     private boolean plainDialog = false;
     public ProgressAnimationDialog(Frame owner, String title) {
          theDialog = new JDialog(owner,true);
          theDialog.setTitle(title);
          this.owner = owner;
          init();
     public ProgressAnimationDialog(Dialog owner, String title) {
          theDialog = new JDialog(owner,true);
          theDialog.setTitle(title);
          this.owner = owner;
          init();
     public ProgressAnimationDialog(Frame owner, String title, String message) {
          theDialog = new JDialog(owner,true);
          theDialog.setTitle(title);
          string = message;
          this.owner = owner;
          init();
     public ProgressAnimationDialog(Dialog owner, String title, String message) {
          theDialog = new JDialog(owner,true);
          theDialog.setTitle(title);
          string = message;
          this.owner = owner;
          init();
     public ProgressAnimationDialog(Frame owner, String title, String message, boolean usePlainDialog) {
          theDialog = new JDialog(owner,true);
          theDialog.setTitle(title);
          string = message;
          this.owner = owner;
          plainDialog = usePlainDialog;
          init();
     public ProgressAnimationDialog(Dialog owner, String title, String message, boolean usePlainDialog) {
          theDialog = new JDialog(owner,true);
          theDialog.setTitle(title);
          string = message;
          this.owner = owner;
          plainDialog = usePlainDialog;
          init();
     private void init() {
          theDialog.setSize(DIALOGSIZE);
          theDialog.setResizable(false);          
          theDialog.getContentPane().setLayout(new BorderLayout());
          if (!plainDialog) {
               theDialog.getContentPane().add(progressBar,BorderLayout.CENTER);
               progressBar.setIndeterminate(true);
               if (string != null) {
                    progressBar.setStringPainted(true);
                    progressBar.setString(string);
          } else {
               JLabel label = new JLabel("loading region....",SwingConstants.CENTER);               
               theDialog.getContentPane().add(label,BorderLayout.CENTER);
     public void start() {
          Thread t = new Thread(this);
          t.start();
     public void run() {
          Point p0 = owner.getLocation();
          Point p1 = new Point();
          p1.setLocation(p0.getX()+owner.getWidth()/2.0,p0.getY()+owner.getHeight()/2.0);
          Point p2 = GUIUtilities.getMidPoint(p1,theDialog);
          theDialog.setLocation(p2);          
          theDialog.show();
     public void stop() {
          theDialog.dispose();
     public static void main(String[] args) {
          JFrame frame = new JFrame("Test ProgressAnimationDialog");
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setSize(600,400);
          frame.setVisible(true);
          ProgressAnimationDialog pad =
               new ProgressAnimationDialog(frame,"Please Wait","Loading Region",true);
          pad.start();
          try {
               Thread.sleep(5000);
          } catch (InterruptedException e) {
               e.printStackTrace();
          pad.stop();
}

Hi Michelle!
I tried out your code: besides the GUIUtilities class, whose reference I commented out, the program ran perfectly. I got a JProgressBar, with the text in the middle, and the indeterminate bar floating across...
What version of Java are you using?
regards,
lutha

Similar Messages

  • Trackpad pointer will not show content while hovering, sometimes it's a hand, somethimes its an arrow, and other times it's a line. Also cant highlight anymore.

    Trackpad pointer will not show content while hovering over the item. Sometimes the pointer is a hand, sometimes it's an arrow, and other times it's a line. Also can no longer highlight, or drag.

    Most commonly used backup methods
    then
    Step by Step to fix your Mac

  • Muse not showing contents of Desktop on Tablet & Phone pages

    My Muse 3.1 is not showing contents of Desktop on Tablet & Phone pages... how do i brought them to Tablet & Phone pages?
    Desktop View
    Tablet View
    Phone View

    Thanks Bob for the reply...
    i was just stuck on that part only.. now its clear.
    What I thought that Muse is automatically copy all the contents from Desktop to Tablet & Phone layout.
    Now we have to copy & paste the layout from Desktop.
    Thanks for help.
    Sanjay

  • All of a sudden the 'join the conversation' popup on usatoday will not show content. Any reason why this just started to happen? Any fixes?

    All of sudden now the 'join the conversation' pop up in usatoday.com does not show content.
    The box will pop up but is blank.
    Will not allow me to post.
    Any fixes for this?
    Thanks

    Does this issue occur on another browser? (Not Google Chrome)
    If it does, this is most likely just a website programming error. Simply report the issue to the website development team. There is nothing we can do on this end.
    If it only occurs in Firefox, please try removing your Firefox cache and cookies. <sup>[https://support.mozilla.org/en-US/kb/clear-cache-history-and-personal-information (More Details)]</sup>
    Please report back soon with the results.

  • TS3276 Email does not show contents, only to and from.

    Email does not show contents, only to and from up top.  Just started doing this last week.  Already deleted account and added it again still same problem.

    Mac OS version?

  • Since i updated lion the pointer will not show contents when i hover the pointer over the item....

    Since i updated lion on mac pro the pointer will not show contents whil hovering the pointer over the item.... ???

    If you use extensions like <i>Adblock Plus</i> or <i>NoScript</i> or <i>Flashblock</i> that can block content then make sure that such extensions aren't blocking content.<br />
    You can see the installed Firefox extensions in "Tools > Add-ons > Extensions".
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]

  • Download file in struts - File save dialog not showing up

    Hi,
    The issue i have is - the file save dialog box which should be displayed on file download is not showing up.
    I have a DAO being called from the Action form SaveDocumentAction which extends DispatchAction and has a download(mapping, request, response,..) method. Below are relevant portions of my code.
    public void showDocument(DocumentTO Doc, HttpServletResponse response){
    //get filename etc
    response.setContentType("application/x-download");
    response.setHeader("Content-Disposition", "attachment; filename=myFile.txt");
    OutputStream out = response.getOutputStream();
    //code for writing from input file to out
    I shld be getting a File Save dialog after response.setHeader(), but I am not. Can anyone tell me where I am going wrong. I have printed SOPs and all print fine, even the file writing part.

    Put this code into a servlet rather than a JSP.
    JSP are for returning text based HTML pages. It adds extra carriage returns into the response that will corrupt the file, and prevent the dialog showing up.
    This code is much better off being in a servlet
    If you are using a FileInputStream, you should be using a ServletOutputStream rather than the JSP writer: response.getOutputStream()
    When dealing with file input in a JSP/Servlet you should use the methods of ServletContext. getRealPath() turns a website relative file into a real location on disk. getResourceAsStream() opens the file for you. getResourceAsStream() is more reliable as it will work even if the web app is deployed in a packed WAR.
    Cheers,
    evnafets

  • ITunes not showing content on iOS devices

    So I have an iPhone 4 and an iPad, both running iOS 4.2.1 under iTunes version 10.1.1. For some reason, whenever I click any of the content tabs under each device (Music, Books, Videos, etc.), iTunes shows that there is nothing on the device even though I can clearly play and view the content on the device itself. I know there have been some issues with 4.2.1 and content not showing up on the device, but has there been any sort of fix on content not being viewable through iTunes? Thanks!

    Also note, this isn't just movies... it happens with music, TV shows, and books as well.  The remote devices can see and play them, but it will not show up in the local iTunes list.
    Additionally, in the "shared" libraries section for iTunes on other computers, the items also do not show up in that list.

  • KM Navigation iview not showing contents

    Hi,
       I am using the KM Navigation iview to show contents in the desktop innerpage below detailed Navigation.When the propert 'height type = Automatic' its not showing any content its showing a single white line.But when i change the 'hieght type= Fixed ' then i could able to see the content with the scroll bar.I know i can change the height,but i cant do it each and everytime when i add the content to the location in KM.
    I need the property to be Automatic.
    Can anybody provide some help on this issue?
    Naga

    Hi Prathamesh,
      I am using KM Navigation iview i could not find the Fech mode property.The fetch mode property will be available for URL iview.
    Hi Atul,
        I changed it to Automatic max height :5000.Still no use.
    When i change the Layout set then i could able to see the content with the property 'Height Type :Automatic'.Currently i am using 'portal favorites explorer' layout set.
    Naga

  • PSA Edit Dialog - Not showing all the columns

    Hi All,
    I need to edit the transaction data for 2LIS_13_VDITM in PSA. when I go to display the PSA data it shows few selected fields in the initial display not all coming in the data source.
    In Order to get that field in Data Display,  I change the display variant and bring the field in the data display .
    Now, When I try to edit that record the the Edit Dialog Pop Up  does not show me all the columns which are there in the Data Display. I checked in the display Selection Tab, the field list over there also does not contain this field.
    However, I am able to edit data for all other Data Sources.
    Has someone ever faced this kind of strange thing.  We were on support pack 18 and migrated to BW 3.1 support pack 20. I was able to edit data in PSA for this data source earlier. Can it be a support Pack Problem ?
    Requesting for your valuable suggestions on this!!!
    Regards
    Deepak

    Hi All,
    The below problem occured due to Support Pack upgrade.
    If you are upgrading Basis Support pack from 47 to 48, you might face this kind of problem.
    OSS Note Number : 821558 proved to be quite handy.
    Regards
    Deepak

  • IPhoto not showing content on iPhone

    My iPhone has some content (images and video) that are not showing up in iPhoto. But iPhoto says all items have already been imported. There's no way to pick items to make it import them.
    iPhone photos settings has Optimize iPhone storage on. Is that related to my issue?

    Yes. Under Albums/All Photos.
    "All Photos" is showing all photos, not only your camera roll. You will only be seeing "All Photos", if iCloud Photo Library (Beta) has been enabled, and then this view is showing you all photos in iCloud. See this link:   Get help finding your Photos in iOS 8 or later - Apple Support
    To download the iCloud photos in addition to your Camera Roll, use the "Photos Beta" app on your iCloud page:
    https://www.icloud.com

  • Aliases not showing content

    Does anyone know if there is a way in LPX to show the content of the aliases in the main window, but also in the Piano Roll.
    If I create a midi region and an alias:
    - The main window shows a mini piano roll for the main region but not for the contents of the alias
    - In the piano roll view, the main region has its contents displayed too, but the alias looks empty. The score editor displays perfectly the content of aliases, in a lighter gray.
    As you can see in the picture, the Verse and Pre-Chorus aliases do not show the a piano roll thumbnail.
    In the piano roll window, they look totally empty.

    I personally rarely use aliases... though they have their uses
    I simply option left click and drag to duplicate a region....
    This method allows much more flexibility I find.... as I can leave the region as a dupe or I can edit the region to make minor or major differences... and the full display of content appears in all editors.
    The disadvantage of this method is you have to edit all regions instead of editing just one to change all the other copies...
    However, if i wish to do the latter... then I simply delete the copies and re-drag the edited original original
    Personal opinion follows;
    As for the fact an alias doesn't show a basic idea of it's contents.. I really don't find that any loss as what you see in a region in the arrange window as being representative of what is inside it, is often useless as it's not very accurate at all.... and as you cannot edit anything in the piano rol in regards to a alias... well, again, I don't find that view very useful either.
    Each to their own of course

  • Homesharing Not showing content

    When i turn on home shareing all works fine, but when i connect with any device it takes a very long time and no media is shown? Why will my itunes not show any media on my iDevices? All latest updates and router is open as much as it can be.

    **** it. I thought it worked both ways. For some reason not all my music downloads from my ipad to other apple products. It was the same when I got my new iphone, Out of 405 songs on my ipad it only transferred 30.
    Thanks for your help it was driving me crazy. I really thought it worked both ways.

  • Download! app not showing content since firmware u...

    I just updated my E65 to the latest firmware and now apps are not showing up in the Download application. I'd really like to get MSN Live Messenger back on my E65.
    Any others with similar problem?
    -jn

    you can transfer the music with MediaGo, this is what I do
    on a PC > open the album with WindowsMediaPlayer > look for the album info > then update the album info > this should allow you to have the correct album art > now transfer the music either through MediaGo or just drag and drop the folder 
    "I'd rather be hated for who I am, than loved for who I am not." Kurt Cobain (1967-1994)

  • Yosemite Mail not showing contents of inbox (Exchange 365)

    Since upgrading to Yosemite my Mac mail inbox has been playing up. All the emails are there and show for a minute or two then the view changes and the inbox appears empty, selecting a different inbox (iCloud account, hotmail, Gmail) and going back to the Exchange inbox will make the message visible again. I have tried rebuilding, deleting the account and adding it again but all to no avail. New messages are coming in and all the mail is there it is just that they do not show (or more precise only show for a short period).
    This is the case both on my mid 2012 MBP and my mid 2013 MBA both running Yosemite version 10.10.

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins* and log in as Guest. Don't use the Safari-only “Guest User” login created by “Find My Mac.”
    While logged in as Guest, you won’t have access to any of your documents or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this behavior; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    *Note: If you’ve activated “Find My Mac” or FileVault, then you can’t enable the Guest account. The “Guest User” login created by “Find My Mac” is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Please take this step regardless of the results of Step 1.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
    Note: If FileVault is enabled in OS X 10.9 or earlier, or if a firmware password is set, or if the startup volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of Steps 1 and 2.

Maybe you are looking for

  • JDBC Async-Sync bridge does not work

    Hi folks. I read the how to guide “How To Realize a sync-async and async-sync bridge within the Adapter Framework” and I found some tips at SDN (i.e File - RFC - File without a BPM - Possible from SP 19.) . So on, I created a scenario JDBC<=>SOAP. My

  • Generate Report -List item permissions against Each list Item

    Hi, I want to get "Item Permission" against each list item from List. I need to prepare a Report from this Information. Can anyone please help to get "Item Permission" against each list

  • ICWC: Is it possible to create a link in a message in the error line

    Hi, after saving a service order in the IC WebClient the success message (including the object id) is shown in the persistent header area of the ICWC - in the error single line.  Is there a possibility to have a link in this area? I want to create a

  • How do I text message to an iPhone4?

    How do I text message to an iPhone4?

  • Services Start up

    Hello, I want to know the order in which the following services should be started & stopped EAS, Planning & Shared Services:      Hyperion S9 Administration Services ATS5      Hyperion S9 BI+ Analytic Services 9.3.1 - hypservice      Hyperion S9 A