Demo: reworked "More Components" tab and added screenshot mode

This commit is contained in:
Karl Tauber
2020-09-01 17:24:26 +02:00
parent 28634cda56
commit cc90a2ad75
5 changed files with 147 additions and 109 deletions

View File

@@ -16,6 +16,7 @@
package com.formdev.flatlaf.demo; package com.formdev.flatlaf.demo;
import java.awt.Component;
import javax.swing.*; import javax.swing.*;
import javax.swing.text.DefaultEditorKit; import javax.swing.text.DefaultEditorKit;
import net.miginfocom.swing.*; import net.miginfocom.swing.*;
@@ -114,14 +115,14 @@ class BasicComponentsPanel
JScrollPane scrollPane12 = new JScrollPane(); JScrollPane scrollPane12 = new JScrollPane();
JTextPane textPane4 = new JTextPane(); JTextPane textPane4 = new JTextPane();
JTextPane textPane5 = new JTextPane(); JTextPane textPane5 = new JTextPane();
JLabel label3 = new JLabel(); JLabel errorHintsLabel = new JLabel();
JTextField textField5 = new JTextField(); JTextField errorHintsTextField = new JTextField();
JComboBox<String> comboBox7 = new JComboBox<>(); JComboBox<String> errorHintsComboBox = new JComboBox<>();
JSpinner spinner3 = new JSpinner(); JSpinner errorHintsSpinner = new JSpinner();
JLabel label4 = new JLabel(); JLabel warningHintsLabel = new JLabel();
JTextField textField7 = new JTextField(); JTextField warningHintsTextField = new JTextField();
JComboBox<String> comboBox8 = new JComboBox<>(); JComboBox<String> warningHintsComboBox = new JComboBox<>();
JSpinner spinner4 = new JSpinner(); JSpinner warningHintsSpinner = new JSpinner();
JPopupMenu popupMenu1 = new JPopupMenu(); JPopupMenu popupMenu1 = new JPopupMenu();
JMenuItem cutMenuItem = new JMenuItem(); JMenuItem cutMenuItem = new JMenuItem();
JMenuItem copyMenuItem = new JMenuItem(); JMenuItem copyMenuItem = new JMenuItem();
@@ -129,12 +130,12 @@ class BasicComponentsPanel
//======== this ======== //======== this ========
setLayout(new MigLayout( setLayout(new MigLayout(
"hidemode 3", "insets dialog,hidemode 3",
// columns // columns
"[]" + "[sizegroup 1]" +
"[]" + "[sizegroup 1]" +
"[]" + "[sizegroup 1]" +
"[]" + "[sizegroup 1]" +
"[]" + "[]" +
"[]", "[]",
// rows // rows
@@ -606,44 +607,44 @@ class BasicComponentsPanel
textPane5.setText("No scroll pane"); textPane5.setText("No scroll pane");
add(textPane5, "cell 5 11,growx"); add(textPane5, "cell 5 11,growx");
//---- label3 ---- //---- errorHintsLabel ----
label3.setText("Error hints:"); errorHintsLabel.setText("Error hints:");
add(label3, "cell 0 12"); add(errorHintsLabel, "cell 0 12");
//---- textField5 ---- //---- errorHintsTextField ----
textField5.putClientProperty("JComponent.outline", "error"); errorHintsTextField.putClientProperty("JComponent.outline", "error");
add(textField5, "cell 1 12,growx"); add(errorHintsTextField, "cell 1 12,growx");
//---- comboBox7 ---- //---- errorHintsComboBox ----
comboBox7.putClientProperty("JComponent.outline", "error"); errorHintsComboBox.putClientProperty("JComponent.outline", "error");
comboBox7.setModel(new DefaultComboBoxModel<>(new String[] { errorHintsComboBox.setModel(new DefaultComboBoxModel<>(new String[] {
"Editable" "Editable"
})); }));
comboBox7.setEditable(true); errorHintsComboBox.setEditable(true);
add(comboBox7, "cell 2 12,growx"); add(errorHintsComboBox, "cell 2 12,growx");
//---- spinner3 ---- //---- errorHintsSpinner ----
spinner3.putClientProperty("JComponent.outline", "error"); errorHintsSpinner.putClientProperty("JComponent.outline", "error");
add(spinner3, "cell 3 12,growx"); add(errorHintsSpinner, "cell 3 12,growx");
//---- label4 ---- //---- warningHintsLabel ----
label4.setText("Warning hints:"); warningHintsLabel.setText("Warning hints:");
add(label4, "cell 0 13"); add(warningHintsLabel, "cell 0 13");
//---- textField7 ---- //---- warningHintsTextField ----
textField7.putClientProperty("JComponent.outline", "warning"); warningHintsTextField.putClientProperty("JComponent.outline", "warning");
add(textField7, "cell 1 13,growx"); add(warningHintsTextField, "cell 1 13,growx");
//---- comboBox8 ---- //---- warningHintsComboBox ----
comboBox8.putClientProperty("JComponent.outline", "warning"); warningHintsComboBox.putClientProperty("JComponent.outline", "warning");
comboBox8.setModel(new DefaultComboBoxModel<>(new String[] { warningHintsComboBox.setModel(new DefaultComboBoxModel<>(new String[] {
"Not editable" "Not editable"
})); }));
add(comboBox8, "cell 2 13,growx"); add(warningHintsComboBox, "cell 2 13,growx");
//---- spinner4 ---- //---- warningHintsSpinner ----
spinner4.putClientProperty("JComponent.outline", "warning"); warningHintsSpinner.putClientProperty("JComponent.outline", "warning");
add(spinner4, "cell 3 13,growx"); add(warningHintsSpinner, "cell 3 13,growx");
//======== popupMenu1 ======== //======== popupMenu1 ========
{ {
@@ -668,6 +669,33 @@ class BasicComponentsPanel
cutMenuItem.addActionListener( new DefaultEditorKit.CutAction() ); cutMenuItem.addActionListener( new DefaultEditorKit.CutAction() );
copyMenuItem.addActionListener( new DefaultEditorKit.CopyAction() ); copyMenuItem.addActionListener( new DefaultEditorKit.CopyAction() );
pasteMenuItem.addActionListener( new DefaultEditorKit.PasteAction() ); pasteMenuItem.addActionListener( new DefaultEditorKit.PasteAction() );
if( FlatLafDemo.screenshotsMode ) {
Component[] components = {
button13, button14, button15, button16, comboBox5, comboBox6,
textField6, passwordField5,
formattedTextFieldLabel, formattedTextField1, formattedTextField2, formattedTextField3, formattedTextField4, formattedTextField5,
textAreaLabel, scrollPane1, scrollPane2, scrollPane3, scrollPane4, textArea5,
editorPaneLabel, scrollPane5, scrollPane6, scrollPane7, scrollPane8, editorPane5,
textPaneLabel, scrollPane9, scrollPane10, scrollPane11, scrollPane12, textPane5,
errorHintsLabel, errorHintsTextField, errorHintsComboBox, errorHintsSpinner,
warningHintsLabel, warningHintsTextField, warningHintsComboBox, warningHintsSpinner,
};
for( Component c : components )
c.setVisible( false );
// move password fields one row up
Component[] formattedTextFields = { formattedTextFieldLabel, formattedTextField1, formattedTextField2, formattedTextField3, formattedTextField4 };
Component[] passwordFields = { passwordFieldLabel, passwordField1, passwordField2, passwordField3, passwordField4 };
MigLayout layout = (MigLayout) getLayout();
for( int i = 0; i < passwordFields.length; i++ ) {
Object cons = layout.getComponentConstraints( formattedTextFields[i] );
layout.setComponentConstraints( passwordFields[i], cons );
}
}
} }
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables

View File

@@ -7,8 +7,8 @@ new FormModel {
"JavaCodeGenerator.defaultVariableLocal": true "JavaCodeGenerator.defaultVariableLocal": true
} }
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$layoutConstraints": "hidemode 3" "$layoutConstraints": "insets dialog,hidemode 3"
"$columnConstraints": "[][][][][][]" "$columnConstraints": "[sizegroup 1][sizegroup 1][sizegroup 1][sizegroup 1][][]"
"$rowConstraints": "[][][][][][][][][][][][]para[][]" "$rowConstraints": "[][][][][][][][][][][][]para[][]"
} ) { } ) {
name: "this" name: "this"
@@ -592,19 +592,19 @@ new FormModel {
"value": "cell 5 11,growx" "value": "cell 5 11,growx"
} ) } )
add( new FormComponent( "javax.swing.JLabel" ) { add( new FormComponent( "javax.swing.JLabel" ) {
name: "label3" name: "errorHintsLabel"
"text": "Error hints:" "text": "Error hints:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 12" "value": "cell 0 12"
} ) } )
add( new FormComponent( "javax.swing.JTextField" ) { add( new FormComponent( "javax.swing.JTextField" ) {
name: "textField5" name: "errorHintsTextField"
"$client.JComponent.outline": "error" "$client.JComponent.outline": "error"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 12,growx" "value": "cell 1 12,growx"
} ) } )
add( new FormComponent( "javax.swing.JComboBox" ) { add( new FormComponent( "javax.swing.JComboBox" ) {
name: "comboBox7" name: "errorHintsComboBox"
"$client.JComponent.outline": "error" "$client.JComponent.outline": "error"
"model": new javax.swing.DefaultComboBoxModel { "model": new javax.swing.DefaultComboBoxModel {
selectedItem: "Editable" selectedItem: "Editable"
@@ -615,25 +615,25 @@ new FormModel {
"value": "cell 2 12,growx" "value": "cell 2 12,growx"
} ) } )
add( new FormComponent( "javax.swing.JSpinner" ) { add( new FormComponent( "javax.swing.JSpinner" ) {
name: "spinner3" name: "errorHintsSpinner"
"$client.JComponent.outline": "error" "$client.JComponent.outline": "error"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 3 12,growx" "value": "cell 3 12,growx"
} ) } )
add( new FormComponent( "javax.swing.JLabel" ) { add( new FormComponent( "javax.swing.JLabel" ) {
name: "label4" name: "warningHintsLabel"
"text": "Warning hints:" "text": "Warning hints:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 13" "value": "cell 0 13"
} ) } )
add( new FormComponent( "javax.swing.JTextField" ) { add( new FormComponent( "javax.swing.JTextField" ) {
name: "textField7" name: "warningHintsTextField"
"$client.JComponent.outline": "warning" "$client.JComponent.outline": "warning"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 13,growx" "value": "cell 1 13,growx"
} ) } )
add( new FormComponent( "javax.swing.JComboBox" ) { add( new FormComponent( "javax.swing.JComboBox" ) {
name: "comboBox8" name: "warningHintsComboBox"
"$client.JComponent.outline": "warning" "$client.JComponent.outline": "warning"
"model": new javax.swing.DefaultComboBoxModel { "model": new javax.swing.DefaultComboBoxModel {
selectedItem: "Not editable" selectedItem: "Not editable"
@@ -643,7 +643,7 @@ new FormModel {
"value": "cell 2 13,growx" "value": "cell 2 13,growx"
} ) } )
add( new FormComponent( "javax.swing.JSpinner" ) { add( new FormComponent( "javax.swing.JSpinner" ) {
name: "spinner4" name: "warningHintsSpinner"
"$client.JComponent.outline": "warning" "$client.JComponent.outline": "warning"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 3 13,growx" "value": "cell 3 13,growx"

View File

@@ -16,6 +16,7 @@
package com.formdev.flatlaf.demo; package com.formdev.flatlaf.demo;
import java.awt.Dimension;
import javax.swing.JDialog; import javax.swing.JDialog;
import javax.swing.JFrame; import javax.swing.JFrame;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
@@ -31,6 +32,8 @@ public class FlatLafDemo
static final String PREFS_ROOT_PATH = "/flatlaf-demo"; static final String PREFS_ROOT_PATH = "/flatlaf-demo";
static final String KEY_TAB = "tab"; static final String KEY_TAB = "tab";
static boolean screenshotsMode = Boolean.parseBoolean( System.getProperty( "flatlaf.demo.screenshotsMode" ) );
public static void main( String[] args ) { public static void main( String[] args ) {
// on macOS enable screen menu bar // on macOS enable screen menu bar
if( SystemInfo.isMacOS && System.getProperty( "apple.laf.useScreenMenuBar" ) == null ) if( SystemInfo.isMacOS && System.getProperty( "apple.laf.useScreenMenuBar" ) == null )
@@ -55,6 +58,9 @@ public class FlatLafDemo
// create frame // create frame
DemoFrame frame = new DemoFrame(); DemoFrame frame = new DemoFrame();
if( FlatLafDemo.screenshotsMode )
frame.setPreferredSize( new Dimension( 1280, 620 ) );
// show frame // show frame
frame.pack(); frame.pack();
frame.setLocationRelativeTo( null ); frame.setLocationRelativeTo( null );

View File

@@ -59,7 +59,6 @@ class MoreComponentsPanel
JSeparator separator2 = new JSeparator(); JSeparator separator2 = new JSeparator();
JSlider slider2 = new JSlider(); JSlider slider2 = new JSlider();
JSlider slider4 = new JSlider(); JSlider slider4 = new JSlider();
JScrollPane scrollPane14 = new JScrollPane();
progressBar3 = new JProgressBar(); progressBar3 = new JProgressBar();
progressBar4 = new JProgressBar(); progressBar4 = new JProgressBar();
JToolBar toolBar2 = new JToolBar(); JToolBar toolBar2 = new JToolBar();
@@ -67,11 +66,12 @@ class MoreComponentsPanel
JButton button10 = new JButton(); JButton button10 = new JButton();
JButton button11 = new JButton(); JButton button11 = new JButton();
JToggleButton toggleButton7 = new JToggleButton(); JToggleButton toggleButton7 = new JToggleButton();
JPanel panel2 = new JPanel();
JLabel scrollBarLabel = new JLabel(); JLabel scrollBarLabel = new JLabel();
JScrollBar scrollBar1 = new JScrollBar(); JScrollBar scrollBar1 = new JScrollBar();
JLabel label4 = new JLabel();
JScrollBar scrollBar4 = new JScrollBar(); JScrollBar scrollBar4 = new JScrollBar();
JPanel panel3 = new JPanel(); JPanel panel3 = new JPanel();
JLabel label4 = new JLabel();
JLabel label3 = new JLabel(); JLabel label3 = new JLabel();
JScrollPane scrollPane15 = new JScrollPane(); JScrollPane scrollPane15 = new JScrollPane();
JEditorPane editorPane6 = new JEditorPane(); JEditorPane editorPane6 = new JEditorPane();
@@ -81,7 +81,6 @@ class MoreComponentsPanel
JScrollBar scrollBar6 = new JScrollBar(); JScrollBar scrollBar6 = new JScrollBar();
JLabel separatorLabel = new JLabel(); JLabel separatorLabel = new JLabel();
JSeparator separator1 = new JSeparator(); JSeparator separator1 = new JSeparator();
JPanel panel2 = new JPanel();
JLabel sliderLabel = new JLabel(); JLabel sliderLabel = new JLabel();
JSlider slider1 = new JSlider(); JSlider slider1 = new JSlider();
JSlider slider6 = new JSlider(); JSlider slider6 = new JSlider();
@@ -105,13 +104,12 @@ class MoreComponentsPanel
//======== this ======== //======== this ========
setLayout(new MigLayout( setLayout(new MigLayout(
"hidemode 3", "insets dialog,hidemode 3",
// columns // columns
"[]" + "[]" +
"[]" + "[]" +
"[]" + "[]" +
"[]" + "[]" +
"[]" +
"[]", "[]",
// rows // rows
"[]" + "[]" +
@@ -142,7 +140,7 @@ class MoreComponentsPanel
} }
scrollPane13.setViewportView(panel1); scrollPane13.setViewportView(panel1);
} }
add(scrollPane13, "cell 1 0,grow,width 70,height 70"); add(scrollPane13, "cell 1 0,grow,width 70,height 40");
add(scrollBar2, "cell 2 0 1 6,growy"); add(scrollBar2, "cell 2 0 1 6,growy");
//---- scrollBar3 ---- //---- scrollBar3 ----
@@ -165,7 +163,7 @@ class MoreComponentsPanel
//---- slider2 ---- //---- slider2 ----
slider2.setOrientation(SwingConstants.VERTICAL); slider2.setOrientation(SwingConstants.VERTICAL);
slider2.setValue(30); slider2.setValue(30);
add(slider2, "cell 2 0 1 6,growy"); add(slider2, "cell 2 0 1 6,growy,height 100");
//---- slider4 ---- //---- slider4 ----
slider4.setMinorTickSpacing(10); slider4.setMinorTickSpacing(10);
@@ -174,19 +172,18 @@ class MoreComponentsPanel
slider4.setPaintLabels(true); slider4.setPaintLabels(true);
slider4.setOrientation(SwingConstants.VERTICAL); slider4.setOrientation(SwingConstants.VERTICAL);
slider4.setValue(30); slider4.setValue(30);
add(slider4, "cell 2 0 1 6,growy"); add(slider4, "cell 2 0 1 6,growy,height 100");
add(scrollPane14, "cell 3 0,grow");
//---- progressBar3 ---- //---- progressBar3 ----
progressBar3.setOrientation(SwingConstants.VERTICAL); progressBar3.setOrientation(SwingConstants.VERTICAL);
progressBar3.setValue(60); progressBar3.setValue(60);
add(progressBar3, "cell 4 0 1 6,growy"); add(progressBar3, "cell 2 0 1 6,growy");
//---- progressBar4 ---- //---- progressBar4 ----
progressBar4.setOrientation(SwingConstants.VERTICAL); progressBar4.setOrientation(SwingConstants.VERTICAL);
progressBar4.setValue(60); progressBar4.setValue(60);
progressBar4.setStringPainted(true); progressBar4.setStringPainted(true);
add(progressBar4, "cell 4 0 1 6,growy"); add(progressBar4, "cell 2 0 1 6,growy");
//======== toolBar2 ======== //======== toolBar2 ========
{ {
@@ -209,7 +206,14 @@ class MoreComponentsPanel
toggleButton7.setIcon(UIManager.getIcon("Tree.closedIcon")); toggleButton7.setIcon(UIManager.getIcon("Tree.closedIcon"));
toolBar2.add(toggleButton7); toolBar2.add(toggleButton7);
} }
add(toolBar2, "cell 4 0 1 6,growy"); add(toolBar2, "cell 2 0 1 6,growy");
//======== panel2 ========
{
panel2.setBorder(new TitledBorder("TitledBorder"));
panel2.setLayout(new FlowLayout());
}
add(panel2, "cell 3 0 1 6,grow");
//---- scrollBarLabel ---- //---- scrollBarLabel ----
scrollBarLabel.setText("JScrollBar:"); scrollBarLabel.setText("JScrollBar:");
@@ -219,10 +223,6 @@ class MoreComponentsPanel
scrollBar1.setOrientation(Adjustable.HORIZONTAL); scrollBar1.setOrientation(Adjustable.HORIZONTAL);
add(scrollBar1, "cell 1 1,growx"); add(scrollBar1, "cell 1 1,growx");
//---- label4 ----
label4.setText("HTML:");
add(label4, "cell 5 1");
//---- scrollBar4 ---- //---- scrollBar4 ----
scrollBar4.setOrientation(Adjustable.HORIZONTAL); scrollBar4.setOrientation(Adjustable.HORIZONTAL);
scrollBar4.setEnabled(false); scrollBar4.setEnabled(false);
@@ -238,11 +238,16 @@ class MoreComponentsPanel
// rows // rows
"[]" + "[]" +
"[]" + "[]" +
"[]" +
"[]")); "[]"));
//---- label4 ----
label4.setText("HTML:");
panel3.add(label4, "cell 0 0");
//---- label3 ---- //---- label3 ----
label3.setText("<html>JLabel HTML<br>Sample <b>content</b><br> <u>text</u> with <a href=\"#\">link</a></html>"); label3.setText("<html>JLabel HTML<br>Sample <b>content</b><br> <u>text</u> with <a href=\"#\">link</a></html>");
panel3.add(label3, "cell 0 0"); panel3.add(label3, "cell 0 1");
//======== scrollPane15 ======== //======== scrollPane15 ========
{ {
@@ -252,7 +257,7 @@ class MoreComponentsPanel
editorPane6.setText("JEditorPane HTML<br>Sample <b>content</b><br> <u>text</u> with <a href=\"#\">link</a>"); editorPane6.setText("JEditorPane HTML<br>Sample <b>content</b><br> <u>text</u> with <a href=\"#\">link</a>");
scrollPane15.setViewportView(editorPane6); scrollPane15.setViewportView(editorPane6);
} }
panel3.add(scrollPane15, "cell 0 1,grow"); panel3.add(scrollPane15, "cell 0 2,grow");
//======== scrollPane16 ======== //======== scrollPane16 ========
{ {
@@ -262,9 +267,9 @@ class MoreComponentsPanel
textPane6.setText("JTextPane HTML<br>Sample <b>content</b><br> <u>text</u> with <a href=\"#\">link</a>"); textPane6.setText("JTextPane HTML<br>Sample <b>content</b><br> <u>text</u> with <a href=\"#\">link</a>");
scrollPane16.setViewportView(textPane6); scrollPane16.setViewportView(textPane6);
} }
panel3.add(scrollPane16, "cell 0 2,grow"); panel3.add(scrollPane16, "cell 0 3,grow");
} }
add(panel3, "cell 5 2 1 9,aligny top,growy 0"); add(panel3, "cell 4 0 1 8,aligny top,growy 0");
//---- scrollBar5 ---- //---- scrollBar5 ----
scrollBar5.setOrientation(Adjustable.HORIZONTAL); scrollBar5.setOrientation(Adjustable.HORIZONTAL);
@@ -282,13 +287,6 @@ class MoreComponentsPanel
add(separatorLabel, "cell 0 5"); add(separatorLabel, "cell 0 5");
add(separator1, "cell 1 5,growx"); add(separator1, "cell 1 5,growx");
//======== panel2 ========
{
panel2.setBorder(new TitledBorder("TitledBorder"));
panel2.setLayout(new FlowLayout());
}
add(panel2, "cell 3 5,grow");
//---- sliderLabel ---- //---- sliderLabel ----
sliderLabel.setText("JSlider:"); sliderLabel.setText("JSlider:");
add(sliderLabel, "cell 0 6"); add(sliderLabel, "cell 0 6");
@@ -389,6 +387,17 @@ class MoreComponentsPanel
} }
add(toolBar1, "cell 1 10 3 1,growx"); add(toolBar1, "cell 1 10 3 1,growx");
// JFormDesigner - End of component initialization //GEN-END:initComponents // JFormDesigner - End of component initialization //GEN-END:initComponents
if( FlatLafDemo.screenshotsMode ) {
Component[] components = new Component[] {
indeterminateCheckBox,
toolTipLabel, toolTip1, toolTip2,
toolBarLabel, toolBar1, toolBar2,
};
for( Component c : components )
c.setVisible( false );
}
} }
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables

View File

@@ -1,4 +1,4 @@
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"
@@ -7,8 +7,8 @@ new FormModel {
"JavaCodeGenerator.defaultVariableLocal": true "JavaCodeGenerator.defaultVariableLocal": true
} }
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$layoutConstraints": "hidemode 3" "$layoutConstraints": "insets dialog,hidemode 3"
"$columnConstraints": "[][][][][][]" "$columnConstraints": "[][][][][]"
"$rowConstraints": "[][][][][][][][][][][]" "$rowConstraints": "[][][][][][][][][][][]"
} ) { } ) {
name: "this" name: "this"
@@ -27,7 +27,7 @@ new FormModel {
"preferredSize": new java.awt.Dimension( 200, 200 ) "preferredSize": new java.awt.Dimension( 200, 200 )
} ) } )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 0,grow,width 70,height 70" "value": "cell 1 0,grow,width 70,height 40"
} ) } )
add( new FormComponent( "javax.swing.JScrollBar" ) { add( new FormComponent( "javax.swing.JScrollBar" ) {
name: "scrollBar2" name: "scrollBar2"
@@ -64,7 +64,7 @@ new FormModel {
"orientation": 1 "orientation": 1
"value": 30 "value": 30
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 0 1 6,growy" "value": "cell 2 0 1 6,growy,height 100"
} ) } )
add( new FormComponent( "javax.swing.JSlider" ) { add( new FormComponent( "javax.swing.JSlider" ) {
name: "slider4" name: "slider4"
@@ -75,12 +75,7 @@ new FormModel {
"orientation": 1 "orientation": 1
"value": 30 "value": 30
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 0 1 6,growy" "value": "cell 2 0 1 6,growy,height 100"
} )
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
name: "scrollPane14"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 3 0,grow"
} ) } )
add( new FormComponent( "javax.swing.JProgressBar" ) { add( new FormComponent( "javax.swing.JProgressBar" ) {
name: "progressBar3" name: "progressBar3"
@@ -90,7 +85,7 @@ new FormModel {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 4 0 1 6,growy" "value": "cell 2 0 1 6,growy"
} ) } )
add( new FormComponent( "javax.swing.JProgressBar" ) { add( new FormComponent( "javax.swing.JProgressBar" ) {
name: "progressBar4" name: "progressBar4"
@@ -101,7 +96,7 @@ new FormModel {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 4 0 1 6,growy" "value": "cell 2 0 1 6,growy"
} ) } )
add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) {
name: "toolBar2" name: "toolBar2"
@@ -126,7 +121,13 @@ new FormModel {
"icon": new com.jformdesigner.model.SwingIcon( 2, "Tree.closedIcon" ) "icon": new com.jformdesigner.model.SwingIcon( 2, "Tree.closedIcon" )
} ) } )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 4 0 1 6,growy" "value": "cell 2 0 1 6,growy"
} )
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) {
name: "panel2"
"border": new javax.swing.border.TitledBorder( "TitledBorder" )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 3 0 1 6,grow"
} ) } )
add( new FormComponent( "javax.swing.JLabel" ) { add( new FormComponent( "javax.swing.JLabel" ) {
name: "scrollBarLabel" name: "scrollBarLabel"
@@ -140,12 +141,6 @@ new FormModel {
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 1,growx" "value": "cell 1 1,growx"
} ) } )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label4"
"text": "HTML:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 5 1"
} )
add( new FormComponent( "javax.swing.JScrollBar" ) { add( new FormComponent( "javax.swing.JScrollBar" ) {
name: "scrollBar4" name: "scrollBar4"
"orientation": 0 "orientation": 0
@@ -155,16 +150,22 @@ new FormModel {
} ) } )
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$columnConstraints": "[]" "$columnConstraints": "[]"
"$rowConstraints": "[][][]" "$rowConstraints": "[][][][]"
"$layoutConstraints": "ltr,insets 0,hidemode 3" "$layoutConstraints": "ltr,insets 0,hidemode 3"
} ) { } ) {
name: "panel3" name: "panel3"
"opaque": false "opaque": false
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label4"
"text": "HTML:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 0"
} )
add( new FormComponent( "javax.swing.JLabel" ) { add( new FormComponent( "javax.swing.JLabel" ) {
name: "label3" name: "label3"
"text": "<html>JLabel HTML<br>Sample <b>content</b><br> <u>text</u> with <a href=\"#\">link</a></html>" "text": "<html>JLabel HTML<br>Sample <b>content</b><br> <u>text</u> with <a href=\"#\">link</a></html>"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 0" "value": "cell 0 1"
} ) } )
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
name: "scrollPane15" name: "scrollPane15"
@@ -174,7 +175,7 @@ new FormModel {
"text": "JEditorPane HTML<br>Sample <b>content</b><br> <u>text</u> with <a href=\"#\">link</a>" "text": "JEditorPane HTML<br>Sample <b>content</b><br> <u>text</u> with <a href=\"#\">link</a>"
} ) } )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 1,grow" "value": "cell 0 2,grow"
} ) } )
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
name: "scrollPane16" name: "scrollPane16"
@@ -184,10 +185,10 @@ new FormModel {
"text": "JTextPane HTML<br>Sample <b>content</b><br> <u>text</u> with <a href=\"#\">link</a>" "text": "JTextPane HTML<br>Sample <b>content</b><br> <u>text</u> with <a href=\"#\">link</a>"
} ) } )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 2,grow" "value": "cell 0 3,grow"
} ) } )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 5 2 1 9,aligny top,growy 0" "value": "cell 4 0 1 8,aligny top,growy 0"
} ) } )
add( new FormComponent( "javax.swing.JScrollBar" ) { add( new FormComponent( "javax.swing.JScrollBar" ) {
name: "scrollBar5" name: "scrollBar5"
@@ -215,12 +216,6 @@ new FormModel {
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 5,growx" "value": "cell 1 5,growx"
} ) } )
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) {
name: "panel2"
"border": new javax.swing.border.TitledBorder( "TitledBorder" )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 3 5,grow"
} )
add( new FormComponent( "javax.swing.JLabel" ) { add( new FormComponent( "javax.swing.JLabel" ) {
name: "sliderLabel" name: "sliderLabel"
"text": "JSlider:" "text": "JSlider:"
@@ -365,7 +360,7 @@ new FormModel {
} ) } )
}, new FormLayoutConstraints( null ) { }, new FormLayoutConstraints( null ) {
"location": new java.awt.Point( 0, 0 ) "location": new java.awt.Point( 0, 0 )
"size": new java.awt.Dimension( 790, 715 ) "size": new java.awt.Dimension( 700, 420 )
} ) } )
} }
} }