Forums Register Login

Screen Flicker in Swing

+Pie Number of slices to send: Send
I'm trying to update 6 text fields at a 10Hz rate using only swing objects. I have double buffering turned on for all objects but I am still experiencing unacceptable flicker. Anyone have any ideas?
+Pie Number of slices to send: Send
How many textfields? And Why do you need to update all the textfields every 10th of a second? A better way to update text fields based on data would be change only the textfields you *need* to cahnge when their background value changes... you can do this using listeners or custom Documents for your textfields...

A lot may depend on the speed of your computer ( how fast it can *really* redraw )and possibly your video card and graphics settings (More pixels = more to redraw) also... Actual redraw is also controlled by a background thread in Java... things like the lowest possible refresh rate and the granularity of the changes are hidden from you... so you may be trying to refresh 10 times a second, but the lowest rate may be 30... or granularity may be 15 milliseconds instead of 10... you'll have to do a bit of testing using System.currentTimeMillis() to find out if your program is *really* refreshing when and as often as you think it is.
+Pie Number of slices to send: Send
This project has a requirement for 10Hz updates. There are 6 text fields displaying some antenna pointing angles and other real time data that must be displayed very quickly. The GUI will also consist of 2 analog dials. I have run some tests and the text fields appear to be updating correctly (i.e. 10X/sec), but the flicker is unacceptable. I have tested this GUI on a Sun Blade 100 and a 1.4 GHz Pentium with a GeForce III video card. The Sun was mostly acceptable but the Pentium was awful.
I am a C++ embedded guy for the most part, so any tips you have are very much appreciated. I'm starting to worry that Java is not going to be adequate for this project.
In addition, do you know anything about Java for DOS or any other flavors of embedded Java?
+Pie Number of slices to send: Send
Hmmm... even if the application as a whole needs to be able to react at a granularity of 10 x per second, I don't think that should mean that the gui should repaint itself at 10 Hz... It would make more sense for whatever code was listening for changes in the real-time stuff query 10 x per second, and only update the GUI if a change has occurred. Then only the fields that need updating would update, and you wouldn't have to worry about needless updates.

I haven't worked any with embedded Java... there is a forum on here about Java 2 Micro Edition, but I'm not sure if it's the same thing...
+Pie Number of slices to send: Send
I think you are right. I will try and use listeners instead. I appreciate your time and help!
We should throw him a surprise party. It will cheer him up. We can use this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 928 times.
Similar Threads
Scrollbar flickers after using setText()
Applet gives Flickering
stop JTable from repainting during process
How to avoid flickering when replacing a panel?
Java3D
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:39:36.