Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / January 2004

Tip: Looking for answers? Try searching our database.

JFrame and its minium dimensions

Thread view: 
Arnoud - 16 Jan 2004 08:43 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.

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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.