From 261d2b1fe871e1815bf3a263ddef1d66d9e3bf68 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Wed, 29 May 2024 18:57:45 +0200 Subject: [PATCH] HTML: Fixed font sizes for HTML tags `

`...`

`, ``, ``, ``, `` and `` in HTML text for components Button, CheckBox, RadioButton, MenuItem (and subclasses), JideLabel, JideButton, JXBusyLabel and JXHyperlink. Also fixed for Label and ToolTip if using Java 11+. --- CHANGELOG.md | 4 + .../com/formdev/flatlaf/ui/FlatButtonUI.java | 4 + .../flatlaf/ui/FlatCheckBoxMenuItemUI.java | 13 +- .../java/com/formdev/flatlaf/ui/FlatHTML.java | 133 ++++++++++++ .../com/formdev/flatlaf/ui/FlatLabelUI.java | 96 +-------- .../formdev/flatlaf/ui/FlatMenuItemUI.java | 12 +- .../com/formdev/flatlaf/ui/FlatMenuUI.java | 12 +- .../flatlaf/ui/FlatRadioButtonMenuItemUI.java | 13 +- .../formdev/flatlaf/ui/FlatRadioButtonUI.java | 5 + .../com/formdev/flatlaf/ui/FlatToolTipUI.java | 8 +- .../flatlaf/jideoss/ui/FlatJideButtonUI.java | 27 +++ .../flatlaf/jideoss/ui/FlatJideLabelUI.java | 16 ++ .../flatlaf/swingx/ui/FlatBusyLabelUI.java | 16 ++ .../flatlaf/swingx/ui/FlatHyperlinkUI.java | 25 +++ .../formdev/flatlaf/testing/FlatHtmlTest.java | 204 ++++++++++++++---- .../formdev/flatlaf/testing/FlatHtmlTest.jfd | 163 +++++++++----- 16 files changed, 555 insertions(+), 196 deletions(-) create mode 100644 flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatHTML.java diff --git a/CHANGELOG.md b/CHANGELOG.md index b01d1fa3d..b551a075e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ FlatLaf Change Log - FlatLaf window decorations: Window top border on Windows 10 in "full window content" mode was not fully repainted when activating or deactivating window. (issue #809) +- HTML: Fixed font sizes for HTML tags `

`...`

`, ``, ``, + ``, `` and `` in HTML text for components Button, CheckBox, + RadioButton, MenuItem (and subclasses), JideLabel, JideButton, JXBusyLabel and + JXHyperlink. Also fixed for Label and ToolTip if using Java 11+. #### Incompatibilities diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonUI.java index 43be898cf..689352430 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonUI.java @@ -300,6 +300,10 @@ protected BasicButtonListener createButtonListener( AbstractButton b ) { protected void propertyChange( AbstractButton b, PropertyChangeEvent e ) { switch( e.getPropertyName() ) { + case BasicHTML.propertyKey: + FlatHTML.updateRendererCSSFontBaseSize( b ); + break; + case SQUARE_SIZE: case MINIMUM_WIDTH: case MINIMUM_HEIGHT: diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatCheckBoxMenuItemUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatCheckBoxMenuItemUI.java index bac450a27..e45676048 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatCheckBoxMenuItemUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatCheckBoxMenuItemUI.java @@ -23,6 +23,7 @@ import java.util.Map; import javax.swing.Icon; import javax.swing.JComponent; +import javax.swing.JMenuItem; import javax.swing.LookAndFeel; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.basic.BasicCheckBoxMenuItemUI; @@ -102,13 +103,23 @@ protected void uninstallDefaults() { oldStyleValues = null; } + @Override + protected void installComponents( JMenuItem menuItem ) { + super.installComponents( menuItem ); + + // update HTML renderer if necessary + FlatHTML.updateRendererCSSFontBaseSize( menuItem ); + } + protected FlatMenuItemRenderer createRenderer() { return new FlatMenuItemRenderer( menuItem, checkIcon, arrowIcon, acceleratorFont, acceleratorDelimiter ); } @Override protected PropertyChangeListener createPropertyChangeListener( JComponent c ) { - return FlatStylingSupport.createPropertyChangeListener( c, this::installStyle, super.createPropertyChangeListener( c ) ); + return FlatHTML.createPropertyChangeListener( + FlatStylingSupport.createPropertyChangeListener( c, this::installStyle, + super.createPropertyChangeListener( c ) ) ); } /** @since 2 */ diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatHTML.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatHTML.java new file mode 100644 index 000000000..a7bd0087c --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatHTML.java @@ -0,0 +1,133 @@ +/* + * Copyright 2024 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.ui; + +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import javax.swing.JComponent; +import javax.swing.plaf.basic.BasicHTML; +import javax.swing.text.Document; +import javax.swing.text.LabelView; +import javax.swing.text.View; +import javax.swing.text.html.HTMLDocument; +import javax.swing.text.html.StyleSheet; + +/** + * @author Karl Tauber + * @since 3.5 + */ +public class FlatHTML +{ + private FlatHTML() {} + + /** + * Adds CSS rule BASE_SIZE to the style sheet of the HTML view, + * which re-calculates font sizes based on current component font size. + * This is necessary for "absolute-size" keywords (e.g. "x-large") + * for "font-size" attributes in default style sheet (see javax/swing/text/html/default.css). + * See also CSS font-size. + *

+ * This method should be invoked after {@link BasicHTML#updateRenderer(JComponent, String)}. + */ + public static void updateRendererCSSFontBaseSize( JComponent c ) { + View view = (View) c.getClientProperty( BasicHTML.propertyKey ); + if( view == null ) + return; + +// dumpViews( view, 0 ); + + Document doc = view.getDocument(); + if( !(doc instanceof HTMLDocument) ) + return; + + // add BASE_SIZE rule if necessary + // - if point size at index 7 is not 36, then probably HTML text contains BASE_SIZE rule + // - if point size at index 4 is equal to given font size, then it is not necessary to add BASE_SIZE rule + StyleSheet styleSheet = ((HTMLDocument)doc).getStyleSheet(); + int fontBaseSize = c.getFont().getSize(); + if( styleSheet.getPointSize( 7 ) != 36f || + styleSheet.getPointSize( 4 ) == fontBaseSize ) + return; + + // BASE_SIZE rule is parsed in javax.swing.text.html.StyleSheet.addRule() + styleSheet.addRule( "BASE_SIZE " + fontBaseSize ); + clearViewCaches( view ); + +// dumpViews( view, 0 ); + } + + /** + * Clears cached values in view so that CSS changes take effect. + */ + private static void clearViewCaches( View view ) { + if( view instanceof LabelView ) + ((LabelView)view).changedUpdate( null, null, null ); + + int viewCount = view.getViewCount(); + for( int i = 0; i < viewCount; i++ ) + clearViewCaches( view.getView( i ) ); + } + + public static PropertyChangeListener createPropertyChangeListener( PropertyChangeListener superListener ) { + return e -> { + if( superListener != null ) + superListener.propertyChange( e ); + propertyChange( e ); + }; + } + + /** + * Invokes {@link #updateRendererCSSFontBaseSize(JComponent)} + * for {@link BasicHTML#propertyKey} property change events, + * which are fired when {@link BasicHTML#updateRenderer(JComponent, String)} + * updates the HTML view. + */ + public static void propertyChange( PropertyChangeEvent e ) { + if( BasicHTML.propertyKey.equals( e.getPropertyName() ) ) + FlatHTML.updateRendererCSSFontBaseSize( (JComponent) e.getSource() ); + } + +/*debug + public static void dumpView( JComponent c ) { + View view = (View) c.getClientProperty( BasicHTML.propertyKey ); + if( view != null ) + dumpViews( view, 0 ); + } + + public static void dumpViews( View view, int indent ) { + for( int i = 0; i < indent; i++ ) + System.out.print( " " ); + System.out.print( view.getClass().isAnonymousClass() ? view.getClass().getName() : view.getClass().getSimpleName() ); + if( view instanceof LabelView ) { + LabelView lview = ((LabelView)view); + Font font = lview.getFont(); + Color foreground = lview.getForeground(); + System.out.printf( " %2d-%-2d %-14s %d #%06x", + lview.getStartOffset(), lview.getEndOffset() - 1, + font.getName(), font.getSize(), + foreground.getRGB() & 0xffffff ); + } + System.out.println(); + + int viewCount = view.getViewCount(); + for( int i = 0; i < viewCount; i++ ) { + View child = view.getView( i ); + dumpViews( child, indent + 1 ); + } + } +debug*/ +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatLabelUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatLabelUI.java index afcf89233..96fe12121 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatLabelUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatLabelUI.java @@ -22,11 +22,7 @@ import java.awt.Graphics2D; import java.awt.Rectangle; import java.beans.PropertyChangeEvent; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Locale; import java.util.Map; -import java.util.Set; import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JLabel; @@ -113,16 +109,13 @@ protected void installComponents( JLabel c ) { super.installComponents( c ); // update HTML renderer if necessary - updateHTMLRenderer( c, c.getText(), false ); + FlatHTML.updateRendererCSSFontBaseSize( c ); } @Override public void propertyChange( PropertyChangeEvent e ) { String name = e.getPropertyName(); - if( name == "text" || name == "font" || name == "foreground" ) { - JLabel label = (JLabel) e.getSource(); - updateHTMLRenderer( label, label.getText(), true ); - } else if( name.equals( FlatClientProperties.STYLE ) || name.equals( FlatClientProperties.STYLE_CLASS ) ) { + if( name.equals( FlatClientProperties.STYLE ) || name.equals( FlatClientProperties.STYLE_CLASS ) ) { JLabel label = (JLabel) e.getSource(); if( shared && FlatStylingSupport.hasStyleProperty( label ) ) { // unshare component UI if necessary @@ -132,8 +125,10 @@ public void propertyChange( PropertyChangeEvent e ) { installStyle( label ); label.revalidate(); label.repaint(); - } else - super.propertyChange( e ); + } + + super.propertyChange( e ); + FlatHTML.propertyChange( e ); } /** @since 2 */ @@ -168,85 +163,6 @@ public Object getStyleableValue( JComponent c, String key ) { return FlatStylingSupport.getAnnotatedStyleableValue( this, key ); } - /** - * Checks whether text contains HTML tags that use "absolute-size" keywords - * (e.g. "x-large") for font-size in default style sheet - * (see javax/swing/text/html/default.css). - * If yes, adds a special CSS rule (BASE_SIZE) to the HTML text, which - * re-calculates font sizes based on current component font size. - */ - static void updateHTMLRenderer( JComponent c, String text, boolean always ) { - if( BasicHTML.isHTMLString( text ) && - c.getClientProperty( "html.disable" ) != Boolean.TRUE && - needsFontBaseSize( text ) ) - { - // BASE_SIZE rule is parsed in javax.swing.text.html.StyleSheet.addRule() - String style = ""; - - String lowerText = text.toLowerCase( Locale.ENGLISH ); - int headIndex; - int styleIndex; - - int insertIndex; - if( (headIndex = lowerText.indexOf( "" )) >= 0 ) { - // there is a tag --> insert after tag - insertIndex = headIndex + "".length(); - } else if( (styleIndex = lowerText.indexOf( "leading red trailing"); - panel2.add(label56, "cell 0 8 7 1"); - - //---- label57 ---- - label57.setText("

leading red trailing

"); - panel2.add(label57, "cell 0 9 7 1"); } - add(panel2, "cell 4 2"); + add(panel2, "cell 4 0 1 3"); // JFormDesigner - End of component initialization //GEN-END:initComponents } diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatHtmlTest.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatHtmlTest.jfd index 7fe5c8a1e..3cd885283 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatHtmlTest.jfd +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatHtmlTest.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "7.0.3.1.342" Java: "15" encoding: "UTF-8" +JFDML JFormDesigner: "8.2.2.0.9999" Java: "21.0.1" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -7,7 +7,7 @@ new FormModel { "JavaCodeGenerator.defaultVariableLocal": true } add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { - "$layoutConstraints": "ltr,insets dialog,hidemode 3" + "$layoutConstraints": "flowy,ltr,insets dialog,hidemode 3" "$columnConstraints": "[grow,sizegroup 1,fill][grow,sizegroup 1,fill][grow,sizegroup 1,fill][grow,sizegroup 1,fill][fill]" "$rowConstraints": "[][fill][grow,fill]" } ) { @@ -39,7 +39,7 @@ new FormModel { add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { "$layoutConstraints": "insets 0,hidemode 3" "$columnConstraints": "[fill][fill][fill]" - "$rowConstraints": "[][][][][][][][][][][][]" + "$rowConstraints": "[][][][][][][][][][][]unrel[][]unrel[][][]para[][]" } ) { name: "panel1" add( new FormComponent( "javax.swing.JLabel" ) { @@ -50,7 +50,7 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "label6" - "text": "Some Bold Text" + "text": "Some Bold Text kbd" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 0" } ) @@ -62,13 +62,13 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "label3" - "text": "JButon:" + "text": "JButton:" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 0 1" } ) add( new FormComponent( "javax.swing.JButton" ) { name: "button1" - "text": "Some Bold Text" + "text": "Some Bold Text kbd" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 1" } ) @@ -86,7 +86,7 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JToggleButton" ) { name: "toggleButton1" - "text": "Some Bold Text" + "text": "Some Bold Text kbd" "selected": true }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 2" @@ -106,7 +106,7 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JCheckBox" ) { name: "checkBox1" - "text": "Some Bold Text" + "text": "Some Bold Text kbd" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 3" } ) @@ -124,7 +124,7 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JRadioButton" ) { name: "radioButton1" - "text": "Some Bold Text" + "text": "Some Bold Text kbd" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 4" } ) @@ -142,7 +142,7 @@ new FormModel { } ) add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { name: "menu1" - "text": "Some Bold Text" + "text": "Some Bold Text kbd" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 5" } ) @@ -160,7 +160,7 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JMenuItem" ) { name: "menuItem1" - "text": "Some Bold Text" + "text": "Some Bold Text kbd" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 6" } ) @@ -178,7 +178,7 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) { name: "checkBoxMenuItem1" - "text": "Some Bold Text" + "text": "Some Bold Text kbd" "selected": true }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 7" @@ -198,7 +198,7 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JRadioButtonMenuItem" ) { name: "radioButtonMenuItem1" - "text": "Some Bold Text" + "text": "Some Bold Text kbd" "selected": true }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 8" @@ -216,17 +216,15 @@ new FormModel { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 0 9" } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label15" - "text": "(move mouse here)" - "toolTipText": "Some Bold Text" + add( new FormComponent( "javax.swing.JToolTip" ) { + name: "toolTip3" + "tipText": "Some Bold Text kbd" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 9" } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label16" - "text": "(move mouse here)" - "toolTipText": "Some text" + add( new FormComponent( "javax.swing.JToolTip" ) { + name: "toolTip4" + "tipText": "Some text" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 2 9" } ) @@ -239,8 +237,8 @@ new FormModel { add( new FormComponent( "javax.swing.JComboBox" ) { name: "comboBox1" "model": new javax.swing.DefaultComboBoxModel { - selectedItem: "Some Bold Text" - addElement( "Some Bold Text" ) + selectedItem: "Some Bold Text kbd" + addElement( "Some Bold Text kbd" ) addElement( "abc" ) addElement( "def" ) } @@ -258,26 +256,111 @@ new FormModel { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 2 10" } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label56" + "text": "JXBusyLabel:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 11" + } ) + add( new FormComponent( "org.jdesktop.swingx.JXBusyLabel" ) { + name: "xBusyLabel1" + "text": "Some Bold Text kbd" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 11" + } ) + add( new FormComponent( "org.jdesktop.swingx.JXBusyLabel" ) { + name: "xBusyLabel2" + "text": "Some text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 11" + } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "label18" "text": "JXHyperlink:" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 11" + "value": "cell 0 12" } ) add( new FormComponent( "org.jdesktop.swingx.JXHyperlink" ) { name: "xHyperlink1" - "text": "Some Bold Text" + "text": "Some Bold Text kbd" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 11" + "value": "cell 1 12" } ) add( new FormComponent( "org.jdesktop.swingx.JXHyperlink" ) { name: "xHyperlink2" "text": "Some text" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 11" + "value": "cell 2 12" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label33" + "text": "JideLabel:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 13" + } ) + add( new FormComponent( "com.jidesoft.swing.JideLabel" ) { + name: "jideLabel1" + "text": "Some Bold Text kbd" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 13" + } ) + add( new FormComponent( "com.jidesoft.swing.JideLabel" ) { + name: "jideLabel2" + "text": "Some text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 13" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label16" + "text": "JideButton:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 14" + } ) + add( new FormComponent( "com.jidesoft.swing.JideButton" ) { + name: "jideButton1" + "text": "Some Bold Text kbd" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 14" + } ) + add( new FormComponent( "com.jidesoft.swing.JideButton" ) { + name: "jideButton2" + "text": "Some text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 14" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label54" + "text": "JideToggleButton:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 15" + } ) + add( new FormComponent( "com.jidesoft.swing.JideToggleButton" ) { + name: "jideToggleButton1" + "text": "Some Bold Text kbd" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 15" + } ) + add( new FormComponent( "com.jidesoft.swing.JideToggleButton" ) { + name: "jideToggleButton2" + "text": "Some text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 15" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "changeHtmlTextButton" + "text": "Change HTML Text" + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "changeHtmlText", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 16" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label15" + "text": "(use to check whether CSS is updated on text changes)" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 17 3 1" } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 4 0 1 2,aligny top,growy 0" + "value": "cell 4 0 1 3,aligny top,growy 0" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "label1" @@ -372,7 +455,7 @@ new FormModel { add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { "$layoutConstraints": "insets 0,hidemode 3" "$columnConstraints": "[fill]para[fill][fill][fill][fill][fill][fill]" - "$rowConstraints": "[][][][][][]para[]para[][][]" + "$rowConstraints": "[][][][][][]" } ) { name: "panel2" auxiliary() { @@ -582,30 +665,12 @@ new FormModel { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 5" } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label54" - "text": "Test whether inserted rule affects display:" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 7 7 1" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label56" - "text": "leading red trailing" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 8 7 1" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label57" - "text": "

leading red trailing

" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 9 7 1" - } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 4 2" + "value": "cell 4 0 1 3" } ) }, new FormLayoutConstraints( null ) { "location": new java.awt.Point( 0, 0 ) - "size": new java.awt.Dimension( 905, 815 ) + "size": new java.awt.Dimension( 905, 880 ) } ) } }