-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
fx1.0
-
N/A
All of the SwingComponents extend Resizable and respond to changing their width and height, but do not have the following properties set:
- maximumHeight
- maximumWidth
- minimumHeight
- minimumWidth
- preferredHeight
- preferredWidth
These are needed to layout the components properly by a Container. The workaround is to get the JComponent and inspect the properties directly as shown here:
var component = (node as SwingComponent).getJComponent();
maximumHeight = component.getMaximumSize().height;
maximumWidth = component.getMaximumSize().width;
minimumHeight = component.getMinimumSize().height;
minimumWidth = component.getMinimumSize().width;
preferredHeight = component.getPreferredSize().height;
preferredWidth = component.getPreferredSize().width;
(this is an excerpt from the JFXtras Grid layout algorithm)
- maximumHeight
- maximumWidth
- minimumHeight
- minimumWidth
- preferredHeight
- preferredWidth
These are needed to layout the components properly by a Container. The workaround is to get the JComponent and inspect the properties directly as shown here:
var component = (node as SwingComponent).getJComponent();
maximumHeight = component.getMaximumSize().height;
maximumWidth = component.getMaximumSize().width;
minimumHeight = component.getMinimumSize().height;
minimumWidth = component.getMinimumSize().width;
preferredHeight = component.getPreferredSize().height;
preferredWidth = component.getPreferredSize().width;
(this is an excerpt from the JFXtras Grid layout algorithm)