Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8106341

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P4
    • None
    • fx1.0
    • javafx
    • N/A

    Description

      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)

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:
              Imported: