-
Notifications
You must be signed in to change notification settings - Fork 110
JProgressBar doesn't render properly off-screen #36
Comments
Hrm. I just found a work-around that does away with the JFrame and gets it to update properly, but am unsure of the consequences. If I call updateUI() on the JProgressBar after each change of value, it works, Not sure why. Can't say I'm overly familiar with how that method works. |
Since this is not the "primary intended" usage of this library, I would need to see a small, standalone and complete sample that reproduces this issue under the latest dev builds. Note that the simpler the setup is, the higher the chances are that I'll get to carve out a chunk of time to take a look at it. There are a lot of moving pieces at play in the Swing rendering pipeline, and without being able to reproduce this issue I can't tell where exactly it fails. |
Okay. That's going to take some time to put together. My current project is not really stand-alone, nor is it small, but my thinking is I can reproduce this bug in a more compact form by painting to a BufferedImage and then displaying that on-screen in a more regular fashion. So, gimme a few hours. Maybe a day. |
All-right, got that done. The attached file should have everything you need to demo this yourself, except for the substance and trident jars (I assume you have them on hand, hehe). All that need be done to see the tests in action is to drop 'substance.jar' and 'trident.jar' into the 'lib' directory and then run the main jar file. Those names need to be exact. I included the Ant script I used to build this, source code and a little readme file (kind of terse version of this message, in case you forget what you're looking at). I tested this with the build that's marked as version 7.1.00-dev, as obtained from here, since you said you wanted it tested against a dev build. I noticed some pretty bizarre behavior from the progress bar that doesn't get calls to it's updateUI() method. Apparently it does update, but it updates incorrectly and can display some very wacky and inaccurate stuff. Most of the time it'll display as either 0% or 100%, while the text version displays perfectly fine. |
I've been working on a simple library to render Swing components for use as OpenGL textures via JOGL and using Substance as the Look and Feel for a larger application.
Basically, I'm using JComponent instances of various types and taking snapshots of them via their paint(Graphics) methods.
When I do so with Substance's Graphite Look and Feel (this is the only Substance theme I've tested with) installed as the default, JProgressBar doesn't display it's progress indicator (the bar itself that moves as things...progress), unless I place it in an un-displayed JFrame and call that frame's pack() method. If I don't call pack(), then the indicator works, but shows the wrong value.
Oddly, thereafter, it would seem that the progress indicator won't move again.
This kind of off-screen rendering seems to work just fine for the Metal Look and Feel with no trouble.
I've attached a couple of screenshots, as rendered by JOGL through my library, to show the difference between the failed version and the works only once version.
The text was updated successfully, but these errors were encountered: