Solved

Exception in ProgressBar paint action

Posted on 2006-06-15
6
352 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

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:mayankeagle
ID: 16920216
Yes, you should let the EDT do "its" job :)
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now