Label and ToolTip: made inserting BASE_SIZE rule into HTML text more reliable

This commit is contained in:
Karl Tauber
2021-02-04 15:10:27 +01:00
parent e5d3c08821
commit be507de6c1
3 changed files with 30 additions and 6 deletions

View File

@@ -145,6 +145,7 @@ public class FlatHtmlTest
JLabel label48 = new JLabel();
JLabel label54 = new JLabel();
JLabel label56 = new JLabel();
JLabel label57 = new JLabel();
//======== this ========
setLayout(new MigLayout(
@@ -443,6 +444,7 @@ public class FlatHtmlTest
"[]para" +
"[]para" +
"[]" +
"[]" +
"[]"));
//---- label22 ----
@@ -588,6 +590,10 @@ public class FlatHtmlTest
//---- label56 ----
label56.setText("<html><head><style>body { color: red }</style></head>leading <big>red</big> trailing</html>");
panel2.add(label56, "cell 0 8 7 1");
//---- label57 ----
label57.setText("<html><style>body { color: red }</style><p>leading <big>red</big> trailing</p></html>");
panel2.add(label57, "cell 0 9 7 1");
}
add(panel2, "cell 4 2");
// JFormDesigner - End of component initialization //GEN-END:initComponents

View File

@@ -372,7 +372,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": "[][][][][][]para[]para[][][]"
} ) {
name: "panel2"
auxiliary() {
@@ -594,6 +594,12 @@ new FormModel {
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 8 7 1"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label57"
"text": "<html><style>body { color: red }</style><p>leading <big>red</big> trailing</p></html>"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 9 7 1"
} )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 4 2"
} )