These methods often return 0,0 as the size. The reason is, they rely on the underlying GUI (Graphic User Interface) to compute the size and if there in no peer object yet, there is no hook to ask the native GUI. See addNotify.
If you want to manually control any of these sizes, e.g. to create a fixed size Component, override all three methods: Component. getMinimumSize(), Component. getMaximumSize() and Component. getPreferredSize().
In Java version 1.5 or later, alternatively you can use Component. setMinimumSize, Component. setMaximumSize and Component. setPreferredSize instead of overriding getXXXXsize methods.
This page is posted |
http://mindprod.com/jgloss/getpreferredsize.html | |
Optional Replicator mirror
|
J:\mindprod\jgloss\getpreferredsize.html | |
Please read the feedback from other visitors,
or send your own feedback about the site. Contact Roedy. Please feel free to link to this page without explicit permission. | ||
Canadian
Mind
Products
IP:[65.110.21.43] Your face IP:[3.137.165.9] |
| |
Feedback |
You are visitor number | |