Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Exception in ProgressBar paint action

Posted on 2006-06-15
6
Medium Priority
?
359 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 

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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

721 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