Re: JFrame resizing
- From: "Kenneth P. Turvey" <kt-usenet@xxxxxxxxxxxxxxxxxx>
- Date: 28 May 2008 12:00:46 GMT
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
.
- Follow-Ups:
- Re: JFrame resizing
- From: Stephan Lukits
- Re: JFrame resizing
- References:
- JFrame resizing
- From: Stephan Lukits
- JFrame resizing
- Prev by Date: JFrame resizing
- Next by Date: Re: JFrame resizing
- Previous by thread: JFrame resizing
- Next by thread: Re: JFrame resizing
- Index(es):