Solved

Exception in ProgressBar paint action

Posted on 2006-06-15
6
353 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
json example 39 132
base64 decode encode 12 122
JUnit 4 @Before and @BeforeClass differences 3 48
How to monitor the number of connections/threads being utilized on Tomcat 6.0 8 56
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
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 “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
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…

895 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