FlatOptionPaneTest: scroll pane added

This commit is contained in:
Karl Tauber
2020-03-27 23:49:25 +01:00
parent 93b82c0e97
commit f2ab848c46
3 changed files with 424 additions and 412 deletions

View File

@@ -1,4 +1,4 @@
JFDML JFormDesigner: "7.0.0.0.194" Java: "11.0.2" encoding: "UTF-8" JFDML JFormDesigner: "7.0.1.0.272" Java: "13.0.2" encoding: "UTF-8"
new FormModel { new FormModel {
contentType: "form/swing" contentType: "form/swing"
@@ -243,7 +243,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, 840 ) "size": new java.awt.Dimension( 840, 900 )
} ) } )
} }
} }

View File

@@ -21,13 +21,14 @@ import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import javax.swing.*; import javax.swing.*;
import javax.swing.border.*; import javax.swing.border.*;
import com.formdev.flatlaf.demo.ScrollablePanel;
import net.miginfocom.swing.*; import net.miginfocom.swing.*;
/** /**
* @author Karl Tauber * @author Karl Tauber
*/ */
public class FlatOptionPaneTest public class FlatOptionPaneTest
extends FlatTestPanel extends JScrollPane
{ {
public static void main( String[] args ) { public static void main( String[] args ) {
SwingUtilities.invokeLater( () -> { SwingUtilities.invokeLater( () -> {
@@ -55,6 +56,7 @@ public class FlatOptionPaneTest
private void initComponents() { private void initComponents() {
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
ScrollablePanel panel9 = new ScrollablePanel();
JLabel plainLabel = new JLabel(); JLabel plainLabel = new JLabel();
JPanel panel1 = new JPanel(); JPanel panel1 = new JPanel();
JOptionPane plainOptionPane = new JOptionPane(); JOptionPane plainOptionPane = new JOptionPane();
@@ -89,7 +91,11 @@ public class FlatOptionPaneTest
FlatOptionPaneTest.ShowDialogLinkLabel customShowDialogLabel = new FlatOptionPaneTest.ShowDialogLinkLabel(); FlatOptionPaneTest.ShowDialogLinkLabel customShowDialogLabel = new FlatOptionPaneTest.ShowDialogLinkLabel();
//======== this ======== //======== this ========
setLayout(new MigLayout( setBorder(BorderFactory.createEmptyBorder());
//======== panel9 ========
{
panel9.setLayout(new MigLayout(
"flowy,ltr,insets dialog,hidemode 3", "flowy,ltr,insets dialog,hidemode 3",
// columns // columns
"[]" + "[]" +
@@ -107,7 +113,7 @@ public class FlatOptionPaneTest
//---- plainLabel ---- //---- plainLabel ----
plainLabel.setText("Plain"); plainLabel.setText("Plain");
add(plainLabel, "cell 0 0"); panel9.add(plainLabel, "cell 0 0");
//======== panel1 ======== //======== panel1 ========
{ {
@@ -118,16 +124,16 @@ public class FlatOptionPaneTest
plainOptionPane.setMessage("Hello world."); plainOptionPane.setMessage("Hello world.");
panel1.add(plainOptionPane, BorderLayout.CENTER); panel1.add(plainOptionPane, BorderLayout.CENTER);
} }
add(panel1, "cell 1 0"); panel9.add(panel1, "cell 1 0");
//---- plainShowDialogLabel ---- //---- plainShowDialogLabel ----
plainShowDialogLabel.setOptionPane(plainOptionPane); plainShowDialogLabel.setOptionPane(plainOptionPane);
plainShowDialogLabel.setTitleLabel(plainLabel); plainShowDialogLabel.setTitleLabel(plainLabel);
add(plainShowDialogLabel, "cell 2 0"); panel9.add(plainShowDialogLabel, "cell 2 0");
//---- errorLabel ---- //---- errorLabel ----
errorLabel.setText("Error"); errorLabel.setText("Error");
add(errorLabel, "cell 0 1"); panel9.add(errorLabel, "cell 0 1");
//======== panel2 ======== //======== panel2 ========
{ {
@@ -140,16 +146,16 @@ public class FlatOptionPaneTest
errorOptionPane.setMessage("Your PC ran into a problem. Buy a new one."); errorOptionPane.setMessage("Your PC ran into a problem. Buy a new one.");
panel2.add(errorOptionPane, BorderLayout.CENTER); panel2.add(errorOptionPane, BorderLayout.CENTER);
} }
add(panel2, "cell 1 1"); panel9.add(panel2, "cell 1 1");
//---- errorShowDialogLabel ---- //---- errorShowDialogLabel ----
errorShowDialogLabel.setTitleLabel(errorLabel); errorShowDialogLabel.setTitleLabel(errorLabel);
errorShowDialogLabel.setOptionPane(errorOptionPane); errorShowDialogLabel.setOptionPane(errorOptionPane);
add(errorShowDialogLabel, "cell 2 1"); panel9.add(errorShowDialogLabel, "cell 2 1");
//---- informationLabel ---- //---- informationLabel ----
informationLabel.setText("Information"); informationLabel.setText("Information");
add(informationLabel, "cell 0 2"); panel9.add(informationLabel, "cell 0 2");
//======== panel3 ======== //======== panel3 ========
{ {
@@ -162,16 +168,16 @@ public class FlatOptionPaneTest
informationOptionPane.setMessage("Text with\nmultiple lines\n(use \\n to separate lines)"); informationOptionPane.setMessage("Text with\nmultiple lines\n(use \\n to separate lines)");
panel3.add(informationOptionPane, BorderLayout.CENTER); panel3.add(informationOptionPane, BorderLayout.CENTER);
} }
add(panel3, "cell 1 2"); panel9.add(panel3, "cell 1 2");
//---- informationShowDialogLabel ---- //---- informationShowDialogLabel ----
informationShowDialogLabel.setOptionPane(informationOptionPane); informationShowDialogLabel.setOptionPane(informationOptionPane);
informationShowDialogLabel.setTitleLabel(informationLabel); informationShowDialogLabel.setTitleLabel(informationLabel);
add(informationShowDialogLabel, "cell 2 2"); panel9.add(informationShowDialogLabel, "cell 2 2");
//---- questionLabel ---- //---- questionLabel ----
questionLabel.setText("Question"); questionLabel.setText("Question");
add(questionLabel, "cell 0 3"); panel9.add(questionLabel, "cell 0 3");
//======== panel4 ======== //======== panel4 ========
{ {
@@ -184,16 +190,16 @@ public class FlatOptionPaneTest
questionOptionPane.setMessage("Answer the question. What question? Don't know. Just writing useless text to make this longer than 80 characters."); questionOptionPane.setMessage("Answer the question. What question? Don't know. Just writing useless text to make this longer than 80 characters.");
panel4.add(questionOptionPane, BorderLayout.CENTER); panel4.add(questionOptionPane, BorderLayout.CENTER);
} }
add(panel4, "cell 1 3"); panel9.add(panel4, "cell 1 3");
//---- questionShowDialogLabel ---- //---- questionShowDialogLabel ----
questionShowDialogLabel.setOptionPane(questionOptionPane); questionShowDialogLabel.setOptionPane(questionOptionPane);
questionShowDialogLabel.setTitleLabel(questionLabel); questionShowDialogLabel.setTitleLabel(questionLabel);
add(questionShowDialogLabel, "cell 2 3"); panel9.add(questionShowDialogLabel, "cell 2 3");
//---- warningLabel ---- //---- warningLabel ----
warningLabel.setText("Warning"); warningLabel.setText("Warning");
add(warningLabel, "cell 0 4"); panel9.add(warningLabel, "cell 0 4");
//======== panel5 ======== //======== panel5 ========
{ {
@@ -206,16 +212,16 @@ public class FlatOptionPaneTest
warningOptionPane.setMessage("<html>I like <b>bold</b>,<br> and I like <i>italic</i>,<br> and I like to have<br> many lines.<br> Lots of lines."); warningOptionPane.setMessage("<html>I like <b>bold</b>,<br> and I like <i>italic</i>,<br> and I like to have<br> many lines.<br> Lots of lines.");
panel5.add(warningOptionPane, BorderLayout.CENTER); panel5.add(warningOptionPane, BorderLayout.CENTER);
} }
add(panel5, "cell 1 4"); panel9.add(panel5, "cell 1 4");
//---- warningShowDialogLabel ---- //---- warningShowDialogLabel ----
warningShowDialogLabel.setOptionPane(warningOptionPane); warningShowDialogLabel.setOptionPane(warningOptionPane);
warningShowDialogLabel.setTitleLabel(warningLabel); warningShowDialogLabel.setTitleLabel(warningLabel);
add(warningShowDialogLabel, "cell 2 4"); panel9.add(warningShowDialogLabel, "cell 2 4");
//---- inputLabel ---- //---- inputLabel ----
inputLabel.setText("Input"); inputLabel.setText("Input");
add(inputLabel, "cell 0 5"); panel9.add(inputLabel, "cell 0 5");
//======== panel7 ======== //======== panel7 ========
{ {
@@ -228,16 +234,16 @@ public class FlatOptionPaneTest
inputOptionPane.setMessage("Enter whatever you want:"); inputOptionPane.setMessage("Enter whatever you want:");
panel7.add(inputOptionPane, BorderLayout.CENTER); panel7.add(inputOptionPane, BorderLayout.CENTER);
} }
add(panel7, "cell 1 5"); panel9.add(panel7, "cell 1 5");
//---- inputShowDialogLabel ---- //---- inputShowDialogLabel ----
inputShowDialogLabel.setOptionPane(inputOptionPane); inputShowDialogLabel.setOptionPane(inputOptionPane);
inputShowDialogLabel.setTitleLabel(inputLabel); inputShowDialogLabel.setTitleLabel(inputLabel);
add(inputShowDialogLabel, "cell 2 5"); panel9.add(inputShowDialogLabel, "cell 2 5");
//---- inputIconLabel ---- //---- inputIconLabel ----
inputIconLabel.setText("Input + icon"); inputIconLabel.setText("Input + icon");
add(inputIconLabel, "cell 0 6"); panel9.add(inputIconLabel, "cell 0 6");
//======== panel8 ======== //======== panel8 ========
{ {
@@ -251,16 +257,16 @@ public class FlatOptionPaneTest
inputIconOptionPane.setMessage("Enter something:"); inputIconOptionPane.setMessage("Enter something:");
panel8.add(inputIconOptionPane, BorderLayout.CENTER); panel8.add(inputIconOptionPane, BorderLayout.CENTER);
} }
add(panel8, "cell 1 6"); panel9.add(panel8, "cell 1 6");
//---- inputIconShowDialogLabel ---- //---- inputIconShowDialogLabel ----
inputIconShowDialogLabel.setTitleLabel(inputIconLabel); inputIconShowDialogLabel.setTitleLabel(inputIconLabel);
inputIconShowDialogLabel.setOptionPane(inputIconOptionPane); inputIconShowDialogLabel.setOptionPane(inputIconOptionPane);
add(inputIconShowDialogLabel, "cell 2 6"); panel9.add(inputIconShowDialogLabel, "cell 2 6");
//---- customLabel ---- //---- customLabel ----
customLabel.setText("Custom"); customLabel.setText("Custom");
add(customLabel, "cell 0 7"); panel9.add(customLabel, "cell 0 7");
//======== panel6 ======== //======== panel6 ========
{ {
@@ -271,12 +277,14 @@ public class FlatOptionPaneTest
customOptionPane.setIcon(UIManager.getIcon("Tree.leafIcon")); customOptionPane.setIcon(UIManager.getIcon("Tree.leafIcon"));
panel6.add(customOptionPane, BorderLayout.CENTER); panel6.add(customOptionPane, BorderLayout.CENTER);
} }
add(panel6, "cell 1 7"); panel9.add(panel6, "cell 1 7");
//---- customShowDialogLabel ---- //---- customShowDialogLabel ----
customShowDialogLabel.setOptionPane(customOptionPane); customShowDialogLabel.setOptionPane(customOptionPane);
customShowDialogLabel.setTitleLabel(customLabel); customShowDialogLabel.setTitleLabel(customLabel);
add(customShowDialogLabel, "cell 2 7"); panel9.add(customShowDialogLabel, "cell 2 7");
}
setViewportView(panel9);
// JFormDesigner - End of component initialization //GEN-END:initComponents // JFormDesigner - End of component initialization //GEN-END:initComponents
} }

View File

@@ -1,4 +1,4 @@
JFDML JFormDesigner: "7.0.0.0.194" Java: "11.0.2" encoding: "UTF-8" JFDML JFormDesigner: "7.0.1.0.272" Java: "13.0.2" encoding: "UTF-8"
new FormModel { new FormModel {
contentType: "form/swing" contentType: "form/swing"
@@ -6,12 +6,15 @@ new FormModel {
auxiliary() { auxiliary() {
"JavaCodeGenerator.defaultVariableLocal": true "JavaCodeGenerator.defaultVariableLocal": true
} }
add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
name: "this"
"border": new javax.swing.border.EmptyBorder( 0, 0, 0, 0 )
add( new FormContainer( "com.formdev.flatlaf.demo.ScrollablePanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$layoutConstraints": "flowy,ltr,insets dialog,hidemode 3" "$layoutConstraints": "flowy,ltr,insets dialog,hidemode 3"
"$columnConstraints": "[][][fill]" "$columnConstraints": "[][][fill]"
"$rowConstraints": "[top][top][top][top][top][top][top][top]" "$rowConstraints": "[top][top][top][top][top][top][top][top]"
} ) { } ) {
name: "this" name: "panel9"
add( new FormComponent( "javax.swing.JLabel" ) { add( new FormComponent( "javax.swing.JLabel" ) {
name: "plainLabel" name: "plainLabel"
"text": "Plain" "text": "Plain"
@@ -237,9 +240,10 @@ new FormModel {
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 7" "value": "cell 2 7"
} ) } )
} )
}, 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, 920 ) "size": new java.awt.Dimension( 840, 900 )
} ) } )
} }
} }