Javax.swing.ProgressMonitor-dialog not showing properly

Hi @all,
I've got a little prob using ProgressMonitor. I'm coding an Applet which loads some images. Since this task may take a while, I'm trying to use ProgressMonitor to show a dialog window with the corresponding progressbar to indicate how much work's done already.
My code looks like this:
// Image[] images has been filled before.
// mt is a MediaTracker which surveys the loading.
ProgressMonitor pm = new ProgressMonitor(
  null,
  "Loading images",
  0,
  images.length - 1
for (int i = 0; i < images.length; i++) {
  pm.setProgress(i);
  pm.setNote(images[ i ].toString());
  // actual image loaded?
  while (!mt.checkID(i, true)) { 
    // if not wait:
    Thread.sleep(10); 
if (mt.checkAll() && !pm.isCanceled() && !mt.isErrorAny()) {
  pm.close();
// everything successfully loadedThe loading of the images works fine. My only prob is with the ProgressMonitor which starts showing after the default time (might be one second) - but the frame it shows is corrupt. You can see the outlines of it, but none of the contents is displayed - not to talk of the progressbar. Simply nothing.
Did anyone encounter this prob as well and has some ideas what's wrong? Any help would be appreciated.
Cheers,
kelysar

Hi.
Solved this one as can be found in the Swing forum at http://forum.java.sun.com/thread.jsp?forum=57&thread=321045
Cheers,
kelysar

Similar Messages

  • Thai characters not showing properly

    Hi,
    When creating a product catalog in thai language the characters do not show properly. The characters have small aspects attached to them that hover above as you can see here http://www.gte-premium.com but when editing in Indesign the small aspects that are meant to hover above overlap the portion of the character below and are not aligned left to right properly.
    I have tried every thai-friendly font I can find but this does not fix the problem, how can I amend this?
    Thanks in advance

    If you're using a well-made font, you can probably get the tone marks to behave by turning on the World-Ready Composer. It's exposed in InDesign CC and CS6, in the Paragraph menu I think, but if you're using an earlier version of InDesign it's a hidden feature that you would need to use a script or a plugin to turn on.

  • Anychart labels not showing properly..

    Hi all...
    Anychart Version: 5.1.2
    I have a bar simple bar chart which calculates surgeons and their percentage of surgeries.
    x axis: surgeon name (labels rotated to 90 degrees)
    y axis: percentage
    If i am just showing 10 surgeons it is showing properly.
    But if am trying to show all the surgeons (around 100 surgeons on x axis).
    The Flash chart x axis labels are not showing properly
    In this thread..Austin suggested to increase the width of the chart
    APEX Flash Chart labels not displaying
    If i increase the width the labels are showing properly. But the chart looks so ugly with huge width. Is there any other way to show the labels properly
    without incresing the chart width
    In Mozilla filefox i checked the XML returned. In the XML it is showing the labels but in the chart
    it is not showing up.
    Sample X axis..
    The X axis is looking like this..
    s s
    u u
    r r
    g g
    e e
    o o
    n n
    1 3
    It is not showing the "surgeon 2" which is between 1 and 2
    This is custom XML that i am using..
    <anychart>
    <margin all="1"/>
    <settings>
    <animation enabled="true"/>
    </settings>
    <charts>
    <chart use_anychart3_data_model="true" use_sets_colors="false">
    <chart_settings>
    <title enabled="True" vertical_padding="30">
    <font bold="True" size="15" />
    <text>Death by Surgeon</text>
    </title>
    <subtitle enabled="True">
    <background enabled="false" />
    <font bold="False" size="15" />
    <text>Arranged by Increasing Annual Rate of Procedure</text>
    </subtitle>
    <footer enabled="true" align="Center" padding="30">
    <background enabled="false" />
    <font bold="False" size="12" color="Red"/>
    <text><![CDATA[Notice: This report generated considered privileged and confidential. &APP_TIME_STAMP.]]></text>
    </footer>
    <axes>
    <y_axis>
    <title><text>Percentage</text></title>
    <labels>
    <format>{%Value}{numDecimals:0}</format>
    </labels>
    </y_axis>
    <x_axis tickmarks_placement="Center">
    <title><text>Surgeon</text></title>
    <labels rotation="90"/>
    </x_axis>
    </axes>
    </chart_settings>
    <data_plot_settings default_series_type="Bar">
    <bar_series>
    <tooltip_settings enabled="True">
    <format>
    {%SeriesName}{numDecimals:2,thousandsSeparator:}
    {%YValue}{numDecimals:2}%
    </format>
    </tooltip_settings>
    <bar_style>
    <states>
    <normal>
    <fill color="%Color"/>
    <border color="DarkColor(%Color)" thickness="1"/>
    </normal>
    <hover>
    <fill color="LightColor(%Color)"/>
    <border thickness="2"/>
    </hover>
    </states>
    </bar_style>
    </bar_series>
    </data_plot_settings>
    #DATA#
    </chart>
    </charts>
    </anychart>please help me to solve this

    Hi,
    100 columns is a lot of columns. I understand why you are having this issue. I think you have two options here:
    First, you could use a scrolling chart.
    your x-axis custom XML would look something like:
    <x_axis tickmarks_placement="Center">
    <title><text>Surgeon</text></title>
    <labels rotation="90"/>
    <zoom enabled="true" allow_drag="false" />
    </x_axis>Second, you could reduce the font size of the labels on the x-axis to a very small number, so that the text of the label is not wider than the column width. With 100 columns, you are probably talking about a terribly small font size, probably making it unreadable.
    your x-axis custom XML would look something like:
    <x_axis tickmarks_placement="Center">
    <title><text>Surgeon</text></title>
    <labels rotation="90">
    <font size="4" />
    </labels>
    </x_axis>Austin
    Edited by: AustinJ on Feb 11, 2011 11:13 AM - fixed typos

  • 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

  • ProgressMonitor not showing properly

    Sorry for cross-posting, but in general Java programming, nobody seems to have any idea. The original thread is http://forum.java.sun.com/thread.jsp?forum=31&thread=319651
    Here's what it's about:
    I've got a little prob using ProgressMonitor. I'm coding an Applet which loads some images. Since this task may take a while, I'm trying to use ProgressMonitor to show a dialog window with the corresponding progressbar to indicate how much work's done already.
    My code looks like this:
    // Image[] images has been filled before.
    // mt is a MediaTracker which surveys the loading.
    ProgressMonitor pm = new ProgressMonitor(
      null,
      "Loading images",
      0,
      images.length - 1
    for (int i = 0; i < images.length; i++) {
      pm.setProgress(i);
      pm.setNote(images[ i ].toString());
      // actual image loaded?
      while (!mt.checkID(i, true)) { 
        // if not wait:
        Thread.sleep(10); 
    if (mt.checkAll() && !pm.isCanceled() && !mt.isErrorAny()) {
      pm.close();
    // everything successfully loadedThe loading of the images works fine. My only prob is with the ProgressMonitor which starts showing after the default time (might be one second) - but the frame it shows is corrupt. You can see the outlines of it, but none of the contents is displayed - not to talk of the progressbar. Simply nothing.
    Did anyone encounter this prob as well and has some ideas what's wrong? Any help would be appreciated.
    Cheers,
    kelysar

    Hi again.
    I get the point described in that other thread - but I've got a little problem transferring the solution to my problem. The situation is this:
    I've got as class derived from JFrame which shall show thumbnails of some images. In the constructor of that class I call an init()-method in which I'm loading the images to be displayed. I want the ProgressMonitor to survey the loading of the images since that's what is taking most time. In short and pseudo-coded this looks like:
    class PicFrame extend JFrame {
      public PicFrame() {
        // do all initializations, and..
        init();  // this shall load the images etc.
        pack();
        show();
      public void init() {
        ProgressMonitor pm = new ProgressMonitor(...);
        pm.setNote("starting");
        pm.setProgress(1);
        for (all images specified in an array) {
          pm.setProgress(index of current image);
          pm.setNote(name of image);
          load image with a MediaTracker
        if (not cancelled and all images loaded fine) pm.close();
    }How am I able to separate the loading of the images into a second thread and update the ProgressMonitor without being blocked by the loading thread?
    I'm still chewing on this - so I'd be glad to see any suggestions.
    Thanks again for the idea.
    cheers,
    kelysar

  • 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

  • Document not showing properly when opening in Acrobat 9 Pro

    When I create a document in InDesign and export it as a PDF, I want to see what it looks like as the PDF. One of the documents that I opened does not look as it should. It only has the photo on the ad but is missing the red background and the words on the ad. As a thumbnail, it looks correct. But, it is not showing up correctly when I open it in Acrobat. Some of the other ads are fine but this one in particular is not showing me all the elements. What do I do to fix this?

    Yes, I have the most current version of AA9. I exported the document from InDesign using the PDF exporter. That is what I have used for years and it has worked fine. I just installed CS4 yesterday.
    I think I realized what the problem is but I don't know how to fix it properly. I actually went back to the preferences in AA9 to the document color options in accessibility and changed it back to its original state (which, I believe, is where nothing is checked). I had originally changed it because I was trying to experiment with the background of the program. It's black and when I open a PDF, I can't see the black border. But I mistakenly changed the document color. Which brings me to the question of: how do you change the background color of the page so that I can see the black border on the document? I sell advertising so I need to be sure that when people send me their ads, they have black borders. And I can't tell when it has the background behind the document so dark. Acrobat Reader has a white background.
    Additionally, can I still install the latest Acrobat Reader and use that instead of AA9 if I want to? It seems easier.

  • Japanese font "MS PGothic" not showing properly in linux machine

    Hi,
    I am using this font "MS PGothic" in my swings application to display Japanese font,
    But in SOME of the linux machines, it is not displayed properly
    linux os : Red Hat linux Enterprise edition 5.0.
    Do I need to install some packages for MS PGothic font to get installed in red hat linux.
    please help.
    Regards,
    bt

    You can get the TTF file and put it in your project, so will not have to care about system configuration.
    Good luck

  • 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

  • OBIEE 10g: BI Publisher page not showing properly

    Hello all,
    I have installed OBIEE 10g on a VM with operating system: XP, service pack 3.
    Analytics and Admin tool (I was able to create a new repository) are showing properly but when i try to login to the BI Publisher I just see two folder available "Shared folders"
    and "My Folders" and all the other functionalities are missing. Also in the Preferences tab I just see "General Preferences"
    and nothing else. I have logged in as an Administrator user but i think the problem is that this user doesn't actually have admin rights when it comes to BI Publisher module.
    I tried to give some more permissions through Analytics>Settings>Manage Privilleges but there was no progress.
    Can you please give me some guidance on that issue?
    Thanks in advance,
    Dina

    Hi,
    i got exactly the same pb. Word 2007 32 bits + Oracle BI Publisher Desktop 11.1.1.7.0 for 32 bit Office on Windows (244 MB)
    I can see the BIP Menu in Word,
    but the sub menus are : menu2007.logon, menu2007.load_xml_dat ... and of course are not working !
    What is wrong ?
    thanks for help

  • JPG from Illustrator not showing properly

    Hi,
    I'm using Illustrator CS4 to make still images like backgrounds and other stuff for my videos. I export them as JPG using the "Use artboard" export option in Illustrator and select "All" so all the artboards export at once.
    I end up in this case two differents backgrounds named "image clip-01.jpg" and "image clip-02.jpg".
    When I import them into Premiere, I can see my two differents images in the Project and Source Panel, but if I drag them into my sequence, those two images become the same. I mean the image number 01 looks like the image number 02. So even if I have two different images with two differents names, the first one preview is not showing in the sequence. I'v double check , re-exporting etc, same thing. Rename the files. Same thing.
    The only way I can have my images to properly show is when I export them one by one in Illustrator. It's ok for two images, but when I have several of them, it's pretty annoying.
    Any ideas how to fix that?
    Thanks!

    What happens if you Open those JPEG's in Photoshop, then just Save them, and Import. Do they now show the proper Image?
    Are you using PrPro CS 5, or 5.5? There was a Bug in CS 5, where Still Images did not show correctly, and the little trip through Photoshop solved the issue. I believe that CS 5.5 fixed that.
    Good luck,
    Hunt

  • Width of my site does not show properly on phones

    If you visit www.emilseres.com from a cellphone (let's say iPhone), why doesn't the width of the site show properly? On your right there will be a white stripe.
    What do I have to change in Muse? (I do not want to create a seperate phone design.)
    Other improvements would also be appreciated 
    Thank you for your time.
    Kind regards,
    Nephor

    Hi Nephor
    Please check if there is any empty text frame or rectangle placed on right side of the page as it will cause the page to stretch thus space will appear.
    https://forums.adobe.com/message/6098206
    Thanks,
    Sanjit

  • Fiscal Year / Periods does not show properly in WebI and compunding

    Hi,
    I have few reports where I am using Fiscal Year /Period as filter.
    I have created a Universe on the top of a SAP BI Query and did not do any customization.
    Then I created a WebI report. In this report I created various filters beside Fiscal Year / Period. When I run report, filter window opens. I can select all other filters but when it comes to Fiscal Year / Period it does not show me the values I want to see. It shows AUG 0001, APR 0025 etc. I want to see AUG 2010, MAR 2009 etc so that I can select them and get the data of the required Fiscal Year / Period. In Cube I have the required data. If I select MAR 0010 etc I donu2019t get any data.
    On the other hand if I put fiscal Year / Period in columns or rows it shows the right value.
    If also run SAP BI Query and Fiscal Year / Period in Variable then on variable screen I can see the right value from where I can select and get the required result.
    Do I have to do any step at Universe level or something else?
    It seems that Fiscal Year / Period is compounding.
    Is there any help?
    Thanks
    Bashir Awan

    Ingo,
    for thanks for igniting my thoughts in this regards.
    Yes these values do exist in SAP BW.
    It is some how compunding the values at filter level.
    It does not let me see the whole value when filter screen popup in BOBJ.
    In SAP whole value shows when variable screen popup, I see three columns Fiscal Year / Period. Text, Posting Period Key, and Posting Year Key.
    Fiscal year / Period Text which shows Aug 2009, Posting Period Key which shows our period 1 to 16, and Fiscal year key which shows 2009 etc.
    Is there any setting in BOBJ which compunds the year for variable screen so that we may see the whole values for filters?
    thanks

  • Equation not showing properly in word 2013

    Hello,
    I have a problem with my MS Word 2013. It seems that when i want to use the equation, under the design ribbon at the equation tools, there's few options for the structures (eg: fractions, script etc.). If you can see there's drop down button for each of
    the options. For instance if you click the fraction drop down, it will have a few kind of fraction to choose but in my case when i click the drop down button, nothing is shown. The slot for each type is there but it does not show the picture so it is hard
    for me to use it. But when I use MS PowerPoint 2013, it seems to be working. It is really weird.
    I tried a few things to solve this but nothing solve this problem for me. Here are a few things that I already tried:
    Repair MS Office 2013 in the installation setup
    Uninstall MS Office 2013 and re-install
    Install Office Compatibility Pack
    None of the above solve the problem. Can anybody help me solve this please? I have no idea what to do anymore.
    See attached picture to see what I explained about and understand my problem better.

    Hi,
    If the Building Blocks template file that comes with Microsoft Word is corrupt, it may cause Equations to not work correctly. To resolve this problem, move the damaged copy of the Building Blocks template out of the user data folder. After you do this,
    Word creates a new Building  Blocks template by using the default content. 
    To do this, please follow:
    1. Exit all Office programs.
    2. Open the file explorer and navigate to:
    C:\Users\%username%\AppData\Roaming\Microsoft\Document Building Blocks\1033\15
    Note: 1033 is the locale identification (LCID) number for English U.S version of Microsoft Office. For a list of locale ID numbers, see
    Locale identification numbers for language-specific files.
    3. Rename the Built-In Building Blocks.dotx
    file to Built-In Building Blocks.old.
    4. Then, navigate to
    C:\Program Files\Microsoft Office\Office15\Document Parts\1033\15
    5. Rename the Built-In Building Blocks.dotx file to
    Built-In Building Blocks.old.
    6. Close both folders.
    7. Now, click Start, click Run, type
    appwiz.cpl, and the click OK.
    8. In the Currently installed programs list, right-click the version of the Office that is installed on the computer, click
    Change, click Repair, and then click Continue.
    9. Restart Word to check the result.
    Regards,
    Steve Fan
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Stock not showing properly in  for Batch determination

    Dear Gurus,
    While doing the following msg appearing since JAN 01, 2008, IN BATCH DETERMINATION THE SYSTEM NOT SHOWING EXACT QUANTITY AS IN ACTUAL STOCK
    Pls help for this issue,
    Regards,
    Atul

    Dear  Jagdish,
    In MMBE in unrestricted use column there is total 16.979 stock position is there and again for posting ( PGI ) after delivery for selecting batch determination Available Qty is showing 9,999,999,999.000
    How I will correct it could not understand.
    Regards,
    Atul

Maybe you are looking for