Re: JFrame resizing



On Wed, 28 May 2008 13:34:27 +0200, Stephan Lukits wrote:

public void paint( Graphics g ) {
if ( getSize().width != 200 || getSize().height != 100 ) {
System.out.println("Frame Size is different"); setSize( 200,
100 );
}
g.drawString( "A test string", 50, 75);
}

Ok, I can't really tell you why this isn't working, but the paint method
is the wrong place for this kind of code. You should put it in a
ComponentListener.



--
Kenneth P. Turvey <kt-usenet@xxxxxxxxxxxxxxxxxx>
http://www.electricsenator.net

In the next place, the soul does violence to itself when it turns away
from any man, or even moves towards him with the intention of injuring,
such as are the souls of those who are angry.
-- Marcus Aurelius Antoninus, Meditations 2-16
.