Prevent Java from redrawing JPanel content on refresh
3 answers
Try RepaintManager.currentManager (component) .markCompletelyClean (component) . This will prevent reprogramming of the component. You may need to do this every time you add new components.
+7
source to share
you can try with help setIgnoreRepaint(boolean value)
, but this is a typical swing function that may or may not work (mainly because it depends on AWT, so you never know).
Otherwise, you can override the method paint
using a flag that simply returns the method instead of being called super.paint()
. (the actual override paintComponent
should be the right choice)
+1
source to share