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

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

    XMLWordPrintable

    Details

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

      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

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

              Dates

              Created:
              Updated:
              Resolved:
              Imported: