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
Optional Replicator mirror
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.
Your face IP:[18.104.22.168]
You are visitor number|