Swing components do not have their min/max/pref Resizable properties set

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: fx1.0
    • Component/s: javafx
    • Environment:

      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)

            Assignee:
            Richard Bair (Inactive)
            Reporter:
            Stephen Chin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: