Dear Java programmers,
How can i set a minium dimension of a JFrame.
I tries to overide the function SetSize, but it din't work.
Yours
Arnoud
ak - 16 Jan 2004 09:22 GMT
> How can i set a minium dimension of a JFrame.
> I tries to overide the function SetSize, but it din't work.
add ComponentListener to your JFrame, hear to componentResized events, and
set size you like if JFrame gets too small.
Its not perfect (flicker), but it works.
____________
http://reader.imagero.com the best java image reader.
Andrew Thompson - 16 Jan 2004 10:10 GMT
....
| How can i set a minium dimension of a JFrame.
| I tries to overide the function SetSize, but it din't work.
You need to override getPreferredSize(), but
usually when a noob asks that, it is because
they do not understand LayoutManagers
well enough to use them correctly.
I suggest you make an example code* and
describe the effect you want to see..
* http://www.physci.org/codes/sscce.jsp
--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
Babu Kalakrishnan - 19 Jan 2004 05:55 GMT
> Dear Java programmers,
>
> How can i set a minium dimension of a JFrame.
> I tries to overide the function SetSize, but it din't work.
You might want to try overriding the method "reshape(int x, int y, int w, int h)"
method instead. As far as I can remember, all variants that change the
location/size of a java.awt.Component eventually end up calling this method.
BK
ak - 19 Jan 2004 09:18 GMT
> You might want to try overriding the method "reshape(int x, int y, int w, int h)"
> method instead. As far as I can remember, all variants that change the
> location/size of a java.awt.Component eventually end up calling this method.
but not if you do resizing with mouse!
So you need ComponentListener.
____________
http://reader.imagero.com the best java image reader.