Window decorations: fixed right aligned progress bar in embedded menu bar was overlapping window title (issue #272)

This commit is contained in:
Karl Tauber
2021-03-23 19:23:18 +01:00
parent f8ee8b27fb
commit 14fc652f4b
4 changed files with 132 additions and 47 deletions

View File

@@ -16,6 +16,8 @@ FlatLaf Change Log
`frame.setVisible(true)`. (issue #277) `frame.setVisible(true)`. (issue #277)
- Custom window decorations: Fixed NPE in `FlatTitlePane.findHorizontalGlue()`. - Custom window decorations: Fixed NPE in `FlatTitlePane.findHorizontalGlue()`.
(issue #275) (issue #275)
- Custom window decorations: Fixed right aligned progress bar in embedded menu
bar was overlapping window title. (issue #272)
- InternalFrame: Fixed translucent internal frame menu bar background if - InternalFrame: Fixed translucent internal frame menu bar background if
`TitlePane.unifiedBackground` is `true`. (issue #274) `TitlePane.unifiedBackground` is `true`. (issue #274)

View File

@@ -197,14 +197,16 @@ public class FlatTitlePane
} }
// If menu bar is embedded and contains a horizontal glue component, // If menu bar is embedded and contains a horizontal glue component,
// then move the title label to the same location as the glue component. // then move the title label to the same location as the glue component
// and give it the same width.
// This allows placing any component on the trailing side of the title pane. // This allows placing any component on the trailing side of the title pane.
JMenuBar menuBar = rootPane.getJMenuBar(); JMenuBar menuBar = rootPane.getJMenuBar();
if( hasVisibleEmbeddedMenuBar( menuBar ) ) { if( hasVisibleEmbeddedMenuBar( menuBar ) ) {
Component horizontalGlue = findHorizontalGlue( menuBar ); Component horizontalGlue = findHorizontalGlue( menuBar );
if( horizontalGlue != null ) { if( horizontalGlue != null ) {
Point glueLocation = SwingUtilities.convertPoint( horizontalGlue, 0, 0, titleLabel ); Point glueLocation = SwingUtilities.convertPoint( horizontalGlue, 0, 0, titleLabel );
titleLabel.setLocation( titleLabel.getX() + glueLocation.x, titleLabel.getY() ); titleLabel.setBounds( titleLabel.getX() + glueLocation.x, titleLabel.getY(),
horizontalGlue.getWidth(), titleLabel.getHeight() );
} }
} }
} }
@@ -450,9 +452,13 @@ public class FlatTitlePane
// This allows placing any component on the trailing side of the title pane. // This allows placing any component on the trailing side of the title pane.
Component horizontalGlue = findHorizontalGlue( rootPane.getJMenuBar() ); Component horizontalGlue = findHorizontalGlue( rootPane.getJMenuBar() );
if( horizontalGlue != null ) { if( horizontalGlue != null ) {
int titleWidth = Math.max( titleLabel.getWidth(), 0 ); // title width may be negative boolean leftToRight = getComponentOrientation().isLeftToRight();
int titleWidth = leftToRight
? buttonPanel.getX() - (leftPanel.getX() + leftPanel.getWidth())
: leftPanel.getX() - (buttonPanel.getX() + buttonPanel.getWidth());
titleWidth = Math.max( titleWidth, 0 ); // title width may be negative
bounds.width += titleWidth; bounds.width += titleWidth;
if( !getComponentOrientation().isLeftToRight() ) if( !leftToRight )
bounds.x -= titleWidth; bounds.x -= titleWidth;
} }

View File

@@ -135,6 +135,48 @@ public class FlatWindowDecorationsTest
menuBar.setVisible( menuBarVisibleCheckBox.isSelected() ); menuBar.setVisible( menuBarVisibleCheckBox.isSelected() );
} }
private void rightCompChanged() {
removeNonMenusFromMenuBar();
if( rightCompCheckBox.isSelected() ) {
rightStretchCompCheckBox.setSelected( false );
JButton myButton = new JButton( "?" );
myButton.putClientProperty( "JButton.buttonType", "toolBarButton" );
myButton.setFocusable( false );
menuBar.add( Box.createGlue() );
menuBar.add( myButton );
}
menuBar.revalidate();
menuBar.repaint();
}
private void rightStretchCompChanged() {
removeNonMenusFromMenuBar();
if( rightStretchCompCheckBox.isSelected() ) {
rightCompCheckBox.setSelected( false );
menuBar.add( Box.createGlue() );
menuBar.add( new JProgressBar() );
}
menuBar.revalidate();
menuBar.repaint();
}
private void removeNonMenusFromMenuBar() {
Component[] components = menuBar.getComponents();
for( int i = components.length - 1; i >= 0; i-- ) {
if( !(components[i] instanceof JMenu) )
menuBar.remove( i );
else
break;
}
}
private void colorizeMenuBar() { private void colorizeMenuBar() {
boolean colorize = colorizeMenuBarCheckBox.isSelected(); boolean colorize = colorizeMenuBarCheckBox.isSelected();
Color menuBarBackground = colorize ? new Color( 0xffccff ) : UIManager.getColor( "MenuBar.background" ); Color menuBarBackground = colorize ? new Color( 0xffccff ) : UIManager.getColor( "MenuBar.background" );
@@ -324,7 +366,7 @@ public class FlatWindowDecorationsTest
private void initComponents() { private void initComponents() {
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
menuBarCheckBox = new JCheckBox(); menuBarCheckBox = new JCheckBox();
unifiedBackgroundCheckBox = new JCheckBox(); rightCompCheckBox = new JCheckBox();
JPanel panel3 = new JPanel(); JPanel panel3 = new JPanel();
addMenuButton = new JButton(); addMenuButton = new JButton();
addGlueButton = new JButton(); addGlueButton = new JButton();
@@ -332,8 +374,10 @@ public class FlatWindowDecorationsTest
changeMenuButton = new JButton(); changeMenuButton = new JButton();
changeTitleButton = new JButton(); changeTitleButton = new JButton();
menuBarEmbeddedCheckBox = new JCheckBox(); menuBarEmbeddedCheckBox = new JCheckBox();
colorizeMenuBarCheckBox = new JCheckBox(); rightStretchCompCheckBox = new JCheckBox();
menuBarVisibleCheckBox = new JCheckBox(); menuBarVisibleCheckBox = new JCheckBox();
colorizeMenuBarCheckBox = new JCheckBox();
unifiedBackgroundCheckBox = new JCheckBox();
colorizeMenusCheckBox = new JCheckBox(); colorizeMenusCheckBox = new JCheckBox();
resizableCheckBox = new JCheckBox(); resizableCheckBox = new JCheckBox();
maximizedBoundsCheckBox = new JCheckBox(); maximizedBoundsCheckBox = new JCheckBox();
@@ -394,6 +438,7 @@ public class FlatWindowDecorationsTest
// rows // rows
"para[]0" + "para[]0" +
"[]0" + "[]0" +
"[]0" +
"[]unrel" + "[]unrel" +
"[]0" + "[]0" +
"[]unrel" + "[]unrel" +
@@ -407,10 +452,10 @@ public class FlatWindowDecorationsTest
menuBarCheckBox.addActionListener(e -> menuBarChanged()); menuBarCheckBox.addActionListener(e -> menuBarChanged());
add(menuBarCheckBox, "cell 0 0"); add(menuBarCheckBox, "cell 0 0");
//---- unifiedBackgroundCheckBox ---- //---- rightCompCheckBox ----
unifiedBackgroundCheckBox.setText("unified background"); rightCompCheckBox.setText("right aligned component");
unifiedBackgroundCheckBox.addActionListener(e -> unifiedBackgroundChanged()); rightCompCheckBox.addActionListener(e -> rightCompChanged());
add(unifiedBackgroundCheckBox, "cell 1 0"); add(rightCompCheckBox, "cell 1 0");
//======== panel3 ======== //======== panel3 ========
{ {
@@ -450,7 +495,7 @@ public class FlatWindowDecorationsTest
changeTitleButton.addActionListener(e -> changeTitle()); changeTitleButton.addActionListener(e -> changeTitle());
panel3.add(changeTitleButton, "cell 0 4"); panel3.add(changeTitleButton, "cell 0 4");
} }
add(panel3, "cell 2 0 1 6,aligny top,growy 0"); add(panel3, "cell 2 0 1 7,aligny top,growy 0");
//---- menuBarEmbeddedCheckBox ---- //---- menuBarEmbeddedCheckBox ----
menuBarEmbeddedCheckBox.setText("embedded menu bar"); menuBarEmbeddedCheckBox.setText("embedded menu bar");
@@ -458,10 +503,10 @@ public class FlatWindowDecorationsTest
menuBarEmbeddedCheckBox.addActionListener(e -> menuBarEmbeddedChanged()); menuBarEmbeddedCheckBox.addActionListener(e -> menuBarEmbeddedChanged());
add(menuBarEmbeddedCheckBox, "cell 0 1"); add(menuBarEmbeddedCheckBox, "cell 0 1");
//---- colorizeMenuBarCheckBox ---- //---- rightStretchCompCheckBox ----
colorizeMenuBarCheckBox.setText("colorize menu bar"); rightStretchCompCheckBox.setText("right aligned stretching component");
colorizeMenuBarCheckBox.addActionListener(e -> colorizeMenuBar()); rightStretchCompCheckBox.addActionListener(e -> rightStretchCompChanged());
add(colorizeMenuBarCheckBox, "cell 1 1"); add(rightStretchCompCheckBox, "cell 1 1");
//---- menuBarVisibleCheckBox ---- //---- menuBarVisibleCheckBox ----
menuBarVisibleCheckBox.setText("menu bar visible"); menuBarVisibleCheckBox.setText("menu bar visible");
@@ -469,39 +514,49 @@ public class FlatWindowDecorationsTest
menuBarVisibleCheckBox.addActionListener(e -> menuBarVisibleChanged()); menuBarVisibleCheckBox.addActionListener(e -> menuBarVisibleChanged());
add(menuBarVisibleCheckBox, "cell 0 2"); add(menuBarVisibleCheckBox, "cell 0 2");
//---- colorizeMenuBarCheckBox ----
colorizeMenuBarCheckBox.setText("colorize menu bar");
colorizeMenuBarCheckBox.addActionListener(e -> colorizeMenuBar());
add(colorizeMenuBarCheckBox, "cell 1 2");
//---- unifiedBackgroundCheckBox ----
unifiedBackgroundCheckBox.setText("unified background");
unifiedBackgroundCheckBox.addActionListener(e -> unifiedBackgroundChanged());
add(unifiedBackgroundCheckBox, "cell 0 3");
//---- colorizeMenusCheckBox ---- //---- colorizeMenusCheckBox ----
colorizeMenusCheckBox.setText("colorize menus"); colorizeMenusCheckBox.setText("colorize menus");
colorizeMenusCheckBox.addActionListener(e -> colorizeMenus()); colorizeMenusCheckBox.addActionListener(e -> colorizeMenus());
add(colorizeMenusCheckBox, "cell 1 2"); add(colorizeMenusCheckBox, "cell 1 3");
//---- resizableCheckBox ---- //---- resizableCheckBox ----
resizableCheckBox.setText("resizable"); resizableCheckBox.setText("resizable");
resizableCheckBox.setSelected(true); resizableCheckBox.setSelected(true);
resizableCheckBox.addActionListener(e -> resizableChanged()); resizableCheckBox.addActionListener(e -> resizableChanged());
add(resizableCheckBox, "cell 0 3"); add(resizableCheckBox, "cell 0 4");
//---- maximizedBoundsCheckBox ---- //---- maximizedBoundsCheckBox ----
maximizedBoundsCheckBox.setText("maximized bounds (50,100, 1000,700)"); maximizedBoundsCheckBox.setText("maximized bounds (50,100, 1000,700)");
maximizedBoundsCheckBox.addActionListener(e -> maximizedBoundsChanged()); maximizedBoundsCheckBox.addActionListener(e -> maximizedBoundsChanged());
add(maximizedBoundsCheckBox, "cell 1 3"); add(maximizedBoundsCheckBox, "cell 1 4");
//---- undecoratedCheckBox ---- //---- undecoratedCheckBox ----
undecoratedCheckBox.setText("undecorated"); undecoratedCheckBox.setText("undecorated");
undecoratedCheckBox.addActionListener(e -> undecoratedChanged()); undecoratedCheckBox.addActionListener(e -> undecoratedChanged());
add(undecoratedCheckBox, "cell 0 4"); add(undecoratedCheckBox, "cell 0 5");
//---- fullScreenCheckBox ---- //---- fullScreenCheckBox ----
fullScreenCheckBox.setText("full screen"); fullScreenCheckBox.setText("full screen");
fullScreenCheckBox.addActionListener(e -> fullScreenChanged()); fullScreenCheckBox.addActionListener(e -> fullScreenChanged());
add(fullScreenCheckBox, "cell 1 4"); add(fullScreenCheckBox, "cell 1 5");
//---- label1 ---- //---- label1 ----
label1.setText("Style:"); label1.setText("Style:");
add(label1, "cell 0 5"); add(label1, "cell 0 6");
//---- label2 ---- //---- label2 ----
label2.setText("Icon:"); label2.setText("Icon:");
add(label2, "cell 1 5"); add(label2, "cell 1 6");
//======== panel1 ======== //======== panel1 ========
{ {
@@ -566,7 +621,7 @@ public class FlatWindowDecorationsTest
styleFileChooserRadioButton.addActionListener(e -> decorationStyleChanged()); styleFileChooserRadioButton.addActionListener(e -> decorationStyleChanged());
panel1.add(styleFileChooserRadioButton, "cell 0 8"); panel1.add(styleFileChooserRadioButton, "cell 0 8");
} }
add(panel1, "cell 0 6"); add(panel1, "cell 0 7");
//======== panel2 ======== //======== panel2 ========
{ {
@@ -595,18 +650,18 @@ public class FlatWindowDecorationsTest
iconTestRandomRadioButton.addActionListener(e -> iconChanged()); iconTestRandomRadioButton.addActionListener(e -> iconChanged());
panel2.add(iconTestRandomRadioButton, "cell 0 2"); panel2.add(iconTestRandomRadioButton, "cell 0 2");
} }
add(panel2, "cell 1 6"); add(panel2, "cell 1 7");
//---- openDialogButton ---- //---- openDialogButton ----
openDialogButton.setText("Open Dialog"); openDialogButton.setText("Open Dialog");
openDialogButton.addActionListener(e -> openDialog()); openDialogButton.addActionListener(e -> openDialog());
add(openDialogButton, "cell 0 7 2 1"); add(openDialogButton, "cell 0 8 2 1");
//---- openFrameButton ---- //---- openFrameButton ----
openFrameButton.setText("Open Frame"); openFrameButton.setText("Open Frame");
openFrameButton.setMnemonic('A'); openFrameButton.setMnemonic('A');
openFrameButton.addActionListener(e -> openFrame()); openFrameButton.addActionListener(e -> openFrame());
add(openFrameButton, "cell 0 7 2 1"); add(openFrameButton, "cell 0 8 2 1");
//======== menuBar ======== //======== menuBar ========
{ {
@@ -798,15 +853,17 @@ public class FlatWindowDecorationsTest
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
private JCheckBox menuBarCheckBox; private JCheckBox menuBarCheckBox;
private JCheckBox unifiedBackgroundCheckBox; private JCheckBox rightCompCheckBox;
private JButton addMenuButton; private JButton addMenuButton;
private JButton addGlueButton; private JButton addGlueButton;
private JButton removeMenuButton; private JButton removeMenuButton;
private JButton changeMenuButton; private JButton changeMenuButton;
private JButton changeTitleButton; private JButton changeTitleButton;
private JCheckBox menuBarEmbeddedCheckBox; private JCheckBox menuBarEmbeddedCheckBox;
private JCheckBox colorizeMenuBarCheckBox; private JCheckBox rightStretchCompCheckBox;
private JCheckBox menuBarVisibleCheckBox; private JCheckBox menuBarVisibleCheckBox;
private JCheckBox colorizeMenuBarCheckBox;
private JCheckBox unifiedBackgroundCheckBox;
private JCheckBox colorizeMenusCheckBox; private JCheckBox colorizeMenusCheckBox;
private JCheckBox resizableCheckBox; private JCheckBox resizableCheckBox;
private JCheckBox maximizedBoundsCheckBox; private JCheckBox maximizedBoundsCheckBox;

View File

@@ -9,7 +9,7 @@ new FormModel {
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": "[left]para[left][fill]" "$columnConstraints": "[left]para[left][fill]"
"$rowConstraints": "para[]0[]0[]unrel[]0[]unrel[][top][]" "$rowConstraints": "para[]0[]0[]0[]unrel[]0[]unrel[][top][]"
} ) { } ) {
name: "this" name: "this"
add( new FormComponent( "javax.swing.JCheckBox" ) { add( new FormComponent( "javax.swing.JCheckBox" ) {
@@ -24,12 +24,12 @@ new FormModel {
"value": "cell 0 0" "value": "cell 0 0"
} ) } )
add( new FormComponent( "javax.swing.JCheckBox" ) { add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "unifiedBackgroundCheckBox" name: "rightCompCheckBox"
"text": "unified background" "text": "right aligned component"
auxiliary() { auxiliary() {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "unifiedBackgroundChanged", false ) ) addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "rightCompChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 0" "value": "cell 1 0"
} ) } )
@@ -90,7 +90,7 @@ new FormModel {
"value": "cell 0 4" "value": "cell 0 4"
} ) } )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 0 1 6,aligny top,growy 0" "value": "cell 2 0 1 7,aligny top,growy 0"
} ) } )
add( new FormComponent( "javax.swing.JCheckBox" ) { add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "menuBarEmbeddedCheckBox" name: "menuBarEmbeddedCheckBox"
@@ -104,12 +104,12 @@ new FormModel {
"value": "cell 0 1" "value": "cell 0 1"
} ) } )
add( new FormComponent( "javax.swing.JCheckBox" ) { add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "colorizeMenuBarCheckBox" name: "rightStretchCompCheckBox"
"text": "colorize menu bar" "text": "right aligned stretching component"
auxiliary() { auxiliary() {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "colorizeMenuBar", false ) ) addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "rightStretchCompChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 1" "value": "cell 1 1"
} ) } )
@@ -124,6 +124,26 @@ new FormModel {
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 2" "value": "cell 0 2"
} ) } )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "colorizeMenuBarCheckBox"
"text": "colorize menu bar"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "colorizeMenuBar", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 2"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "unifiedBackgroundCheckBox"
"text": "unified background"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "unifiedBackgroundChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 3"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) { add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "colorizeMenusCheckBox" name: "colorizeMenusCheckBox"
"text": "colorize menus" "text": "colorize menus"
@@ -132,7 +152,7 @@ new FormModel {
} }
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "colorizeMenus", false ) ) addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "colorizeMenus", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 2" "value": "cell 1 3"
} ) } )
add( new FormComponent( "javax.swing.JCheckBox" ) { add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "resizableCheckBox" name: "resizableCheckBox"
@@ -143,7 +163,7 @@ new FormModel {
} }
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "resizableChanged", false ) ) addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "resizableChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 3" "value": "cell 0 4"
} ) } )
add( new FormComponent( "javax.swing.JCheckBox" ) { add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "maximizedBoundsCheckBox" name: "maximizedBoundsCheckBox"
@@ -153,7 +173,7 @@ new FormModel {
} }
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "maximizedBoundsChanged", false ) ) addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "maximizedBoundsChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 3" "value": "cell 1 4"
} ) } )
add( new FormComponent( "javax.swing.JCheckBox" ) { add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "undecoratedCheckBox" name: "undecoratedCheckBox"
@@ -163,7 +183,7 @@ new FormModel {
} }
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "undecoratedChanged", false ) ) addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "undecoratedChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 4" "value": "cell 0 5"
} ) } )
add( new FormComponent( "javax.swing.JCheckBox" ) { add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "fullScreenCheckBox" name: "fullScreenCheckBox"
@@ -173,19 +193,19 @@ new FormModel {
} }
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "fullScreenChanged", false ) ) addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "fullScreenChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 4" "value": "cell 1 5"
} ) } )
add( new FormComponent( "javax.swing.JLabel" ) { add( new FormComponent( "javax.swing.JLabel" ) {
name: "label1" name: "label1"
"text": "Style:" "text": "Style:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 5" "value": "cell 0 6"
} ) } )
add( new FormComponent( "javax.swing.JLabel" ) { add( new FormComponent( "javax.swing.JLabel" ) {
name: "label2" name: "label2"
"text": "Icon:" "text": "Icon:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 5" "value": "cell 1 6"
} ) } )
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": "[fill]" "$columnConstraints": "[fill]"
@@ -294,7 +314,7 @@ new FormModel {
"value": "cell 0 8" "value": "cell 0 8"
} ) } )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 6" "value": "cell 0 7"
} ) } )
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": "[fill]" "$columnConstraints": "[fill]"
@@ -337,14 +357,14 @@ new FormModel {
"value": "cell 0 2" "value": "cell 0 2"
} ) } )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 6" "value": "cell 1 7"
} ) } )
add( new FormComponent( "javax.swing.JButton" ) { add( new FormComponent( "javax.swing.JButton" ) {
name: "openDialogButton" name: "openDialogButton"
"text": "Open Dialog" "text": "Open Dialog"
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "openDialog", false ) ) addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "openDialog", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 7 2 1" "value": "cell 0 8 2 1"
} ) } )
add( new FormComponent( "javax.swing.JButton" ) { add( new FormComponent( "javax.swing.JButton" ) {
name: "openFrameButton" name: "openFrameButton"
@@ -352,7 +372,7 @@ new FormModel {
"mnemonic": 65 "mnemonic": 65
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "openFrame", false ) ) addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "openFrame", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 7 2 1" "value": "cell 0 8 2 1"
} ) } )
}, new FormLayoutConstraints( null ) { }, new FormLayoutConstraints( null ) {
"location": new java.awt.Point( 0, 0 ) "location": new java.awt.Point( 0, 0 )