Hi there,
I'm trying to override the paint method on a JFrame so that the frame is blank as it is resized and when the resize is finished it gets back to normal and redraws.
Overriding ComponentListesner.componentResized(ComponentEvent e) only tells me when the JFrame resize is completed. Ideally I want to disable painting as the JFrame is resizing.
So that's no good
Also tried overriding:
MouseListener.mousePressed (to record the jframe's width and height)
MouseMotionListener.mouseDragged( to compare current jframe size with recorded ones above, and if so stop paint() on JFrame)
MouseListener.mouseReleased( to reset the paint() method back to normal and repaint the JFrame)
However, this doesn't work as when resizing the JFrame no MouseEvents are fired
Another way I found was to create a separate
Thread that would report on the size of the JFrame at various intervals. This is not ideal, as I don't wan't to waste resources like, I don't want a separate thread for something that will not be used that much.
Does anyone know a better way of accomplishing this?
Thank you,
Fabricio