English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2 answers

There is no "getSpace()" method anywhere in Swing. Did you perhaps mean "getSize()"?

Inherited (and perhaps overwritten) by all Swing components:
java.awt.Component class -> Dimension getSize()
java.awt.Component class -> Rectangle getBounds()
java.awt.Component class -> Dimension getPreferredSize()

Some layout managers (such as FlowLayout) use the getPreferredSize() method to determine how much "real estate" to give the component when doing the layout.

Also, these methods are overloaded, with versions that take a parameter into which the values are set and the parameter instance is returned.

Hope this helps.

2006-09-25 06:47:53 · answer #1 · answered by vincentgl 5 · 0 0

There's also a way to get the "gap" distance in some Layout Managers. But that would be an odd way to ask about that.

2006-09-25 11:13:56 · answer #2 · answered by Dr.Mr.Ed 5 · 0 0

fedest.com, questions and answers