mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
fixed/improved vertical position of HTML text when scaled on HiDPI screens on Windows
This commit is contained in:
@@ -329,6 +329,11 @@ public class FlatButtonUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paint( Graphics g, JComponent c ) {
|
||||||
|
super.paint( FlatLabelUI.createGraphicsHTMLTextYCorrection( g, c ), c );
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void paintText( Graphics g, AbstractButton b, Rectangle textRect, String text ) {
|
protected void paintText( Graphics g, AbstractButton b, Rectangle textRect, String text ) {
|
||||||
if( isHelpButton( b ) )
|
if( isHelpButton( b ) )
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ import javax.swing.UIManager;
|
|||||||
import javax.swing.plaf.ComponentUI;
|
import javax.swing.plaf.ComponentUI;
|
||||||
import javax.swing.plaf.basic.BasicHTML;
|
import javax.swing.plaf.basic.BasicHTML;
|
||||||
import javax.swing.plaf.basic.BasicLabelUI;
|
import javax.swing.plaf.basic.BasicLabelUI;
|
||||||
import javax.swing.text.View;
|
|
||||||
import com.formdev.flatlaf.FlatLaf;
|
import com.formdev.flatlaf.FlatLaf;
|
||||||
import com.formdev.flatlaf.util.HiDPIUtils;
|
import com.formdev.flatlaf.util.HiDPIUtils;
|
||||||
import com.formdev.flatlaf.util.UIScale;
|
import com.formdev.flatlaf.util.UIScale;
|
||||||
@@ -127,10 +126,15 @@ public class FlatLabelUI
|
|||||||
BasicHTML.updateRenderer( c, text );
|
BasicHTML.updateRenderer( c, text );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Graphics createGraphicsHTMLTextYCorrection( Graphics g, JComponent c ) {
|
||||||
|
return (c.getClientProperty( BasicHTML.propertyKey ) != null)
|
||||||
|
? HiDPIUtils.createGraphicsTextYCorrection( (Graphics2D) g )
|
||||||
|
: g;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void paint( Graphics g, JComponent c ) {
|
public void paint( Graphics g, JComponent c ) {
|
||||||
View v = (View) c.getClientProperty( BasicHTML.propertyKey );
|
super.paint( createGraphicsHTMLTextYCorrection( g, c ), c );
|
||||||
super.paint( (v != null) ? HiDPIUtils.createGraphicsTextYCorrection( (Graphics2D) g ) : g, c );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import javax.swing.plaf.basic.BasicHTML;
|
|||||||
import javax.swing.text.View;
|
import javax.swing.text.View;
|
||||||
import com.formdev.flatlaf.FlatLaf;
|
import com.formdev.flatlaf.FlatLaf;
|
||||||
import com.formdev.flatlaf.util.Graphics2DProxy;
|
import com.formdev.flatlaf.util.Graphics2DProxy;
|
||||||
|
import com.formdev.flatlaf.util.HiDPIUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renderer for menu items.
|
* Renderer for menu items.
|
||||||
@@ -360,7 +361,7 @@ debug*/
|
|||||||
if( isArmedOrSelected( menuItem ) && selectionForeground != null )
|
if( isArmedOrSelected( menuItem ) && selectionForeground != null )
|
||||||
g = new GraphicsProxyWithTextColor( (Graphics2D) g, selectionForeground );
|
g = new GraphicsProxyWithTextColor( (Graphics2D) g, selectionForeground );
|
||||||
|
|
||||||
htmlView.paint( g, textRect );
|
htmlView.paint( HiDPIUtils.createGraphicsTextYCorrection( (Graphics2D) g ), textRect );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static boolean isArmedOrSelected( JMenuItem menuItem ) {
|
protected static boolean isArmedOrSelected( JMenuItem menuItem ) {
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import javax.swing.LookAndFeel;
|
|||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
import javax.swing.plaf.ComponentUI;
|
import javax.swing.plaf.ComponentUI;
|
||||||
import javax.swing.plaf.basic.BasicProgressBarUI;
|
import javax.swing.plaf.basic.BasicProgressBarUI;
|
||||||
|
import com.formdev.flatlaf.util.HiDPIUtils;
|
||||||
import com.formdev.flatlaf.util.UIScale;
|
import com.formdev.flatlaf.util.UIScale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -194,6 +195,11 @@ public class FlatProgressBarUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void paintString( Graphics g, int x, int y, int width, int height, int amountFull, Insets b ) {
|
||||||
|
super.paintString( HiDPIUtils.createGraphicsTextYCorrection( (Graphics2D) g ), x, y, width, height, amountFull, b );
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setAnimationIndex( int newValue ) {
|
protected void setAnimationIndex( int newValue ) {
|
||||||
super.setAnimationIndex( newValue );
|
super.setAnimationIndex( newValue );
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ public class FlatRadioButtonUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
super.paint( g, c );
|
super.paint( FlatLabelUI.createGraphicsHTMLTextYCorrection( g, c ), c );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -58,6 +58,34 @@ public class FlatHtmlTest
|
|||||||
editorPaneLabel = new JLabel();
|
editorPaneLabel = new JLabel();
|
||||||
textPaneLabel = new JLabel();
|
textPaneLabel = new JLabel();
|
||||||
toolTipLabel = new JLabel();
|
toolTipLabel = new JLabel();
|
||||||
|
panel1 = new JPanel();
|
||||||
|
label5 = new JLabel();
|
||||||
|
label6 = new JLabel();
|
||||||
|
label7 = new JLabel();
|
||||||
|
label3 = new JLabel();
|
||||||
|
button1 = new JButton();
|
||||||
|
button2 = new JButton();
|
||||||
|
label11 = new JLabel();
|
||||||
|
toggleButton1 = new JToggleButton();
|
||||||
|
toggleButton2 = new JToggleButton();
|
||||||
|
label12 = new JLabel();
|
||||||
|
checkBox1 = new JCheckBox();
|
||||||
|
checkBox2 = new JCheckBox();
|
||||||
|
label13 = new JLabel();
|
||||||
|
radioButton1 = new JRadioButton();
|
||||||
|
radioButton2 = new JRadioButton();
|
||||||
|
label8 = new JLabel();
|
||||||
|
menu1 = new JMenu();
|
||||||
|
menu2 = new JMenu();
|
||||||
|
label4 = new JLabel();
|
||||||
|
menuItem1 = new JMenuItem();
|
||||||
|
menuItem2 = new JMenuItem();
|
||||||
|
label9 = new JLabel();
|
||||||
|
checkBoxMenuItem1 = new JCheckBoxMenuItem();
|
||||||
|
checkBoxMenuItem2 = new JCheckBoxMenuItem();
|
||||||
|
label10 = new JLabel();
|
||||||
|
radioButtonMenuItem1 = new JRadioButtonMenuItem();
|
||||||
|
radioButtonMenuItem2 = new JRadioButtonMenuItem();
|
||||||
label1 = new JLabel();
|
label1 = new JLabel();
|
||||||
scrollPane15 = new JScrollPane();
|
scrollPane15 = new JScrollPane();
|
||||||
editorPane1 = new JEditorPane();
|
editorPane1 = new JEditorPane();
|
||||||
@@ -78,6 +106,7 @@ public class FlatHtmlTest
|
|||||||
"[fill]" +
|
"[fill]" +
|
||||||
"[fill]" +
|
"[fill]" +
|
||||||
"[fill]" +
|
"[fill]" +
|
||||||
|
"[fill]" +
|
||||||
"[fill]",
|
"[fill]",
|
||||||
// rows
|
// rows
|
||||||
"[]" +
|
"[]" +
|
||||||
@@ -100,6 +129,145 @@ public class FlatHtmlTest
|
|||||||
toolTipLabel.setText("JToolTip:");
|
toolTipLabel.setText("JToolTip:");
|
||||||
add(toolTipLabel, "cell 3 0");
|
add(toolTipLabel, "cell 3 0");
|
||||||
|
|
||||||
|
//======== panel1 ========
|
||||||
|
{
|
||||||
|
panel1.setLayout(new MigLayout(
|
||||||
|
"insets 0,hidemode 3",
|
||||||
|
// columns
|
||||||
|
"[fill]" +
|
||||||
|
"[fill]" +
|
||||||
|
"[fill]",
|
||||||
|
// rows
|
||||||
|
"[]" +
|
||||||
|
"[]" +
|
||||||
|
"[]" +
|
||||||
|
"[]" +
|
||||||
|
"[]" +
|
||||||
|
"[]" +
|
||||||
|
"[]" +
|
||||||
|
"[]" +
|
||||||
|
"[]"));
|
||||||
|
|
||||||
|
//---- label5 ----
|
||||||
|
label5.setText("JLabel:");
|
||||||
|
panel1.add(label5, "cell 0 0");
|
||||||
|
|
||||||
|
//---- label6 ----
|
||||||
|
label6.setText("<html>Some <b>Bold</b> Text");
|
||||||
|
panel1.add(label6, "cell 1 0");
|
||||||
|
|
||||||
|
//---- label7 ----
|
||||||
|
label7.setText("Some text");
|
||||||
|
panel1.add(label7, "cell 2 0");
|
||||||
|
|
||||||
|
//---- label3 ----
|
||||||
|
label3.setText("JButon:");
|
||||||
|
panel1.add(label3, "cell 0 1");
|
||||||
|
|
||||||
|
//---- button1 ----
|
||||||
|
button1.setText("<html>Some <b>Bold</b> Text");
|
||||||
|
panel1.add(button1, "cell 1 1");
|
||||||
|
|
||||||
|
//---- button2 ----
|
||||||
|
button2.setText("Some text");
|
||||||
|
panel1.add(button2, "cell 2 1");
|
||||||
|
|
||||||
|
//---- label11 ----
|
||||||
|
label11.setText("text");
|
||||||
|
panel1.add(label11, "cell 0 2");
|
||||||
|
|
||||||
|
//---- toggleButton1 ----
|
||||||
|
toggleButton1.setText("<html>Some <b>Bold</b> Text");
|
||||||
|
toggleButton1.setSelected(true);
|
||||||
|
panel1.add(toggleButton1, "cell 1 2");
|
||||||
|
|
||||||
|
//---- toggleButton2 ----
|
||||||
|
toggleButton2.setText("Some text");
|
||||||
|
toggleButton2.setSelected(true);
|
||||||
|
panel1.add(toggleButton2, "cell 2 2");
|
||||||
|
|
||||||
|
//---- label12 ----
|
||||||
|
label12.setText("text");
|
||||||
|
panel1.add(label12, "cell 0 3");
|
||||||
|
|
||||||
|
//---- checkBox1 ----
|
||||||
|
checkBox1.setText("<html>Some <b>Bold</b> Text");
|
||||||
|
panel1.add(checkBox1, "cell 1 3");
|
||||||
|
|
||||||
|
//---- checkBox2 ----
|
||||||
|
checkBox2.setText("Some text");
|
||||||
|
panel1.add(checkBox2, "cell 2 3");
|
||||||
|
|
||||||
|
//---- label13 ----
|
||||||
|
label13.setText("text");
|
||||||
|
panel1.add(label13, "cell 0 4");
|
||||||
|
|
||||||
|
//---- radioButton1 ----
|
||||||
|
radioButton1.setText("<html>Some <b>Bold</b> Text");
|
||||||
|
panel1.add(radioButton1, "cell 1 4");
|
||||||
|
|
||||||
|
//---- radioButton2 ----
|
||||||
|
radioButton2.setText("Some text");
|
||||||
|
panel1.add(radioButton2, "cell 2 4");
|
||||||
|
|
||||||
|
//---- label8 ----
|
||||||
|
label8.setText("JMenu:");
|
||||||
|
panel1.add(label8, "cell 0 5");
|
||||||
|
|
||||||
|
//======== menu1 ========
|
||||||
|
{
|
||||||
|
menu1.setText("<html>Some <b>Bold</b> Text");
|
||||||
|
}
|
||||||
|
panel1.add(menu1, "cell 1 5");
|
||||||
|
|
||||||
|
//======== menu2 ========
|
||||||
|
{
|
||||||
|
menu2.setText("Some text");
|
||||||
|
}
|
||||||
|
panel1.add(menu2, "cell 2 5");
|
||||||
|
|
||||||
|
//---- label4 ----
|
||||||
|
label4.setText("JMenuItem:");
|
||||||
|
panel1.add(label4, "cell 0 6");
|
||||||
|
|
||||||
|
//---- menuItem1 ----
|
||||||
|
menuItem1.setText("<html>Some <b>Bold</b> Text");
|
||||||
|
panel1.add(menuItem1, "cell 1 6");
|
||||||
|
|
||||||
|
//---- menuItem2 ----
|
||||||
|
menuItem2.setText("Some text");
|
||||||
|
panel1.add(menuItem2, "cell 2 6");
|
||||||
|
|
||||||
|
//---- label9 ----
|
||||||
|
label9.setText("JCheckBoxMenuItem:");
|
||||||
|
panel1.add(label9, "cell 0 7");
|
||||||
|
|
||||||
|
//---- checkBoxMenuItem1 ----
|
||||||
|
checkBoxMenuItem1.setText("<html>Some <b>Bold</b> Text");
|
||||||
|
checkBoxMenuItem1.setSelected(true);
|
||||||
|
panel1.add(checkBoxMenuItem1, "cell 1 7");
|
||||||
|
|
||||||
|
//---- checkBoxMenuItem2 ----
|
||||||
|
checkBoxMenuItem2.setText("Some text");
|
||||||
|
checkBoxMenuItem2.setSelected(true);
|
||||||
|
panel1.add(checkBoxMenuItem2, "cell 2 7");
|
||||||
|
|
||||||
|
//---- label10 ----
|
||||||
|
label10.setText("JRadioButtonMenuItem:");
|
||||||
|
panel1.add(label10, "cell 0 8");
|
||||||
|
|
||||||
|
//---- radioButtonMenuItem1 ----
|
||||||
|
radioButtonMenuItem1.setText("<html>Some <b>Bold</b> Text");
|
||||||
|
radioButtonMenuItem1.setSelected(true);
|
||||||
|
panel1.add(radioButtonMenuItem1, "cell 1 8");
|
||||||
|
|
||||||
|
//---- radioButtonMenuItem2 ----
|
||||||
|
radioButtonMenuItem2.setText("Some text");
|
||||||
|
radioButtonMenuItem2.setSelected(true);
|
||||||
|
panel1.add(radioButtonMenuItem2, "cell 2 8");
|
||||||
|
}
|
||||||
|
add(panel1, "cell 4 0 1 3,aligny top,growy 0");
|
||||||
|
|
||||||
//---- label1 ----
|
//---- label1 ----
|
||||||
label1.setText("<html>HTML<br>Sample <b>content</b><br> <u>text</u> with <a href=\"#\">link</a><h1>Header 1</h1><h2>Header 2</h2><h3>Header 3</h3><h4>Header 4</h4><h5>Header 5</h5><h6>Header 6</h6><p>Paragraph</p><hr><table border=\"1\"><tr><th>Col 1</th><th>Col 2</th></tr><tr><td>abc</td><td>def</td></tr></table><ul><li>item 1</li><li>item 2</li></ul></html>");
|
label1.setText("<html>HTML<br>Sample <b>content</b><br> <u>text</u> with <a href=\"#\">link</a><h1>Header 1</h1><h2>Header 2</h2><h3>Header 3</h3><h4>Header 4</h4><h5>Header 5</h5><h6>Header 6</h6><p>Paragraph</p><hr><table border=\"1\"><tr><th>Col 1</th><th>Col 2</th></tr><tr><td>abc</td><td>def</td></tr></table><ul><li>item 1</li><li>item 2</li></ul></html>");
|
||||||
add(label1, "cell 0 1");
|
add(label1, "cell 0 1");
|
||||||
@@ -183,6 +351,34 @@ public class FlatHtmlTest
|
|||||||
private JLabel editorPaneLabel;
|
private JLabel editorPaneLabel;
|
||||||
private JLabel textPaneLabel;
|
private JLabel textPaneLabel;
|
||||||
private JLabel toolTipLabel;
|
private JLabel toolTipLabel;
|
||||||
|
private JPanel panel1;
|
||||||
|
private JLabel label5;
|
||||||
|
private JLabel label6;
|
||||||
|
private JLabel label7;
|
||||||
|
private JLabel label3;
|
||||||
|
private JButton button1;
|
||||||
|
private JButton button2;
|
||||||
|
private JLabel label11;
|
||||||
|
private JToggleButton toggleButton1;
|
||||||
|
private JToggleButton toggleButton2;
|
||||||
|
private JLabel label12;
|
||||||
|
private JCheckBox checkBox1;
|
||||||
|
private JCheckBox checkBox2;
|
||||||
|
private JLabel label13;
|
||||||
|
private JRadioButton radioButton1;
|
||||||
|
private JRadioButton radioButton2;
|
||||||
|
private JLabel label8;
|
||||||
|
private JMenu menu1;
|
||||||
|
private JMenu menu2;
|
||||||
|
private JLabel label4;
|
||||||
|
private JMenuItem menuItem1;
|
||||||
|
private JMenuItem menuItem2;
|
||||||
|
private JLabel label9;
|
||||||
|
private JCheckBoxMenuItem checkBoxMenuItem1;
|
||||||
|
private JCheckBoxMenuItem checkBoxMenuItem2;
|
||||||
|
private JLabel label10;
|
||||||
|
private JRadioButtonMenuItem radioButtonMenuItem1;
|
||||||
|
private JRadioButtonMenuItem radioButtonMenuItem2;
|
||||||
private JLabel label1;
|
private JLabel label1;
|
||||||
private JScrollPane scrollPane15;
|
private JScrollPane scrollPane15;
|
||||||
private JEditorPane editorPane1;
|
private JEditorPane editorPane1;
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
JFDML JFormDesigner: "7.0.1.0.272" Java: "13.0.2" encoding: "UTF-8"
|
JFDML JFormDesigner: "7.0.2.0.298" Java: "14" encoding: "UTF-8"
|
||||||
|
|
||||||
new FormModel {
|
new FormModel {
|
||||||
contentType: "form/swing"
|
contentType: "form/swing"
|
||||||
root: new FormRoot {
|
root: new FormRoot {
|
||||||
add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||||
"$layoutConstraints": "ltr,insets dialog,hidemode 3"
|
"$layoutConstraints": "ltr,insets dialog,hidemode 3"
|
||||||
"$columnConstraints": "[fill][fill][fill][fill]"
|
"$columnConstraints": "[fill][fill][fill][fill][fill]"
|
||||||
"$rowConstraints": "[][top][top]"
|
"$rowConstraints": "[][top][top]"
|
||||||
} ) {
|
} ) {
|
||||||
name: "this"
|
name: "this"
|
||||||
@@ -33,6 +33,183 @@ new FormModel {
|
|||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 3 0"
|
"value": "cell 3 0"
|
||||||
} )
|
} )
|
||||||
|
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||||
|
"$layoutConstraints": "insets 0,hidemode 3"
|
||||||
|
"$columnConstraints": "[fill][fill][fill]"
|
||||||
|
"$rowConstraints": "[][][][][][][][][]"
|
||||||
|
} ) {
|
||||||
|
name: "panel1"
|
||||||
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
|
name: "label5"
|
||||||
|
"text": "JLabel:"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 0 0"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
|
name: "label6"
|
||||||
|
"text": "<html>Some <b>Bold</b> Text"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 1 0"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
|
name: "label7"
|
||||||
|
"text": "Some text"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 2 0"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
|
name: "label3"
|
||||||
|
"text": "JButon:"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 0 1"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JButton" ) {
|
||||||
|
name: "button1"
|
||||||
|
"text": "<html>Some <b>Bold</b> Text"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 1 1"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JButton" ) {
|
||||||
|
name: "button2"
|
||||||
|
"text": "Some text"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 2 1"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
|
name: "label11"
|
||||||
|
"text": "text"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 0 2"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||||
|
name: "toggleButton1"
|
||||||
|
"text": "<html>Some <b>Bold</b> Text"
|
||||||
|
"selected": true
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 1 2"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||||
|
name: "toggleButton2"
|
||||||
|
"text": "Some text"
|
||||||
|
"selected": true
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 2 2"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
|
name: "label12"
|
||||||
|
"text": "text"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 0 3"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||||
|
name: "checkBox1"
|
||||||
|
"text": "<html>Some <b>Bold</b> Text"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 1 3"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||||
|
name: "checkBox2"
|
||||||
|
"text": "Some text"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 2 3"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
|
name: "label13"
|
||||||
|
"text": "text"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 0 4"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||||
|
name: "radioButton1"
|
||||||
|
"text": "<html>Some <b>Bold</b> Text"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 1 4"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||||
|
name: "radioButton2"
|
||||||
|
"text": "Some text"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 2 4"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
|
name: "label8"
|
||||||
|
"text": "JMenu:"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 0 5"
|
||||||
|
} )
|
||||||
|
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
|
||||||
|
name: "menu1"
|
||||||
|
"text": "<html>Some <b>Bold</b> Text"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 1 5"
|
||||||
|
} )
|
||||||
|
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
|
||||||
|
name: "menu2"
|
||||||
|
"text": "Some text"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 2 5"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
|
name: "label4"
|
||||||
|
"text": "JMenuItem:"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 0 6"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||||
|
name: "menuItem1"
|
||||||
|
"text": "<html>Some <b>Bold</b> Text"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 1 6"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||||
|
name: "menuItem2"
|
||||||
|
"text": "Some text"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 2 6"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
|
name: "label9"
|
||||||
|
"text": "JCheckBoxMenuItem:"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 0 7"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) {
|
||||||
|
name: "checkBoxMenuItem1"
|
||||||
|
"text": "<html>Some <b>Bold</b> Text"
|
||||||
|
"selected": true
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 1 7"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) {
|
||||||
|
name: "checkBoxMenuItem2"
|
||||||
|
"text": "Some text"
|
||||||
|
"selected": true
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 2 7"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
|
name: "label10"
|
||||||
|
"text": "JRadioButtonMenuItem:"
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 0 8"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JRadioButtonMenuItem" ) {
|
||||||
|
name: "radioButtonMenuItem1"
|
||||||
|
"text": "<html>Some <b>Bold</b> Text"
|
||||||
|
"selected": true
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 1 8"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JRadioButtonMenuItem" ) {
|
||||||
|
name: "radioButtonMenuItem2"
|
||||||
|
"text": "Some text"
|
||||||
|
"selected": true
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 2 8"
|
||||||
|
} )
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 4 0 1 3,aligny top,growy 0"
|
||||||
|
} )
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "label1"
|
name: "label1"
|
||||||
"text": "<html>HTML<br>Sample <b>content</b><br> <u>text</u> with <a href=\"#\">link</a><h1>Header 1</h1><h2>Header 2</h2><h3>Header 3</h3><h4>Header 4</h4><h5>Header 5</h5><h6>Header 6</h6><p>Paragraph</p><hr><table border=\"1\"><tr><th>Col 1</th><th>Col 2</th></tr><tr><td>abc</td><td>def</td></tr></table><ul><li>item 1</li><li>item 2</li></ul></html>"
|
"text": "<html>HTML<br>Sample <b>content</b><br> <u>text</u> with <a href=\"#\">link</a><h1>Header 1</h1><h2>Header 2</h2><h3>Header 3</h3><h4>Header 4</h4><h5>Header 5</h5><h6>Header 6</h6><p>Paragraph</p><hr><table border=\"1\"><tr><th>Col 1</th><th>Col 2</th></tr><tr><td>abc</td><td>def</td></tr></table><ul><li>item 1</li><li>item 2</li></ul></html>"
|
||||||
|
|||||||
Reference in New Issue
Block a user