Solved

Exception in ProgressBar paint action

Posted on 2006-06-15
6
355 Views
Last Modified: 2008-01-09
Could anyone tell me is there a known bug in ProgressBar code in the swing package?

Im getting the following exception

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
      at javax.swing.plaf.basic.BasicProgressBarUI.updateSizes(BasicProgressBarUI.java:428)
      at javax.swing.plaf.basic.BasicProgressBarUI.getBox(BasicProgressBarUI.java:385)
      at com.sun.java.swing.plaf.windows.WindowsProgressBarUI.paintIndeterminate(WindowsProgressBarUI.java:156)
      at javax.swing.plaf.basic.BasicProgressBarUI.paint(BasicProgressBarUI.java:350)
)

If there is, could you give me a link to where it has been reported?

Thanks a mill
mcgettiu
0
Comment
Question by:mcgettiu
  • 3
  • 2
6 Comments
 
LVL 92

Expert Comment

by:objects
ID: 16916787
0
 

Author Comment

by:mcgettiu
ID: 16918526
Hi objects

I saw that bug alright.....
They had a subclass of JProgressBar that overrides setIndeterminate() and isIndeterminate() - that was the root of the problem there.

I am actually just using JProgressBar so dont think that bug applies to me.

0
 
LVL 92

Expert Comment

by:objects
ID: 16918559
so you're not doing anything exotic?
One thing to check is that you aren't updating the progress bar from a thread other than the event dispatch thread.
If you're not then probleably worth reporting as a bug.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:mcgettiu
ID: 16919160
The exception isn't thrown all the time......

If it was the case that the progress bar was being updated by a thread other than the event dispatch thread - I assume the exception would be thrown everytime???
0
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 16919171
not at all, in fact the opposite. Updating the gui from a different thread *will* result in random exceptions.
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16920216
Yes, you should let the EDT do "its" job :)
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question