diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatFileChooserDetailsViewIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatFileChooserDetailsViewIcon.java index 9293124a..78953301 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatFileChooserDetailsViewIcon.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatFileChooserDetailsViewIcon.java @@ -39,17 +39,21 @@ public class FlatFileChooserDetailsViewIcon /* - - - - + + + + + + */ - g.fillRect( 3, 3, 4, 4 ); - g.fillRect( 3, 9, 4, 4 ); - g.fillRect( 9, 9, 4, 4 ); - g.fillRect( 9, 3, 4, 4 ); + g.fillRect( 2, 3, 2, 2 ); + g.fillRect( 2, 7, 2, 2 ); + g.fillRect( 2, 11, 2, 2 ); + g.fillRect( 6, 3, 8, 2 ); + g.fillRect( 6, 7, 8, 2 ); + g.fillRect( 6, 11, 8, 2 ); } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatFileChooserListViewIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatFileChooserListViewIcon.java index cc744b7d..d644f24a 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatFileChooserListViewIcon.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatFileChooserListViewIcon.java @@ -39,21 +39,17 @@ public class FlatFileChooserListViewIcon /* - - - - - - + + + + */ - g.fillRect( 2, 3, 2, 2 ); - g.fillRect( 2, 7, 2, 2 ); - g.fillRect( 2, 11, 2, 2 ); - g.fillRect( 6, 3, 8, 2 ); - g.fillRect( 6, 7, 8, 2 ); - g.fillRect( 6, 11, 8, 2 ); + g.fillRect( 3, 3, 4, 4 ); + g.fillRect( 3, 9, 4, 4 ); + g.fillRect( 9, 9, 4, 4 ); + g.fillRect( 9, 3, 4, 4 ); } } diff --git a/flatlaf-core/src/test/java/com/formdev/flatlaf/FlatChooserTest.java b/flatlaf-core/src/test/java/com/formdev/flatlaf/FlatChooserTest.java index c3570cf0..ba313746 100644 --- a/flatlaf-core/src/test/java/com/formdev/flatlaf/FlatChooserTest.java +++ b/flatlaf-core/src/test/java/com/formdev/flatlaf/FlatChooserTest.java @@ -40,6 +40,17 @@ public class FlatChooserTest JColorChooser colorChooser1 = new JColorChooser(); JLabel fileChooserLabel = new JLabel(); JFileChooser fileChooser1 = new JFileChooser(); + JLabel label1 = new JLabel(); + JLabel label2 = new JLabel(); + JLabel label3 = new JLabel(); + JLabel label4 = new JLabel(); + JLabel label5 = new JLabel(); + JLabel label6 = new JLabel(); + JLabel label7 = new JLabel(); + JLabel label8 = new JLabel(); + JLabel label9 = new JLabel(); + JLabel label10 = new JLabel(); + JLabel label11 = new JLabel(); //======== this ======== setLayout(new MigLayout( @@ -49,7 +60,8 @@ public class FlatChooserTest "[]", // rows "[top]" + - "[top]")); + "[top]" + + "[]")); //---- colorChooserLabel ---- colorChooserLabel.setText("JColorChooser:"); @@ -60,6 +72,50 @@ public class FlatChooserTest fileChooserLabel.setText("JFileChooser:"); add(fileChooserLabel, "cell 0 1"); add(fileChooser1, "cell 1 1"); + + //---- label1 ---- + label1.setText("icons:"); + add(label1, "cell 0 2"); + + //---- label2 ---- + label2.setIcon(UIManager.getIcon("FileView.directoryIcon")); + add(label2, "cell 1 2"); + + //---- label3 ---- + label3.setIcon(UIManager.getIcon("FileView.fileIcon")); + add(label3, "cell 1 2"); + + //---- label4 ---- + label4.setIcon(UIManager.getIcon("FileView.computerIcon")); + add(label4, "cell 1 2"); + + //---- label5 ---- + label5.setIcon(UIManager.getIcon("FileView.hardDriveIcon")); + add(label5, "cell 1 2"); + + //---- label6 ---- + label6.setIcon(UIManager.getIcon("FileView.floppyDriveIcon")); + add(label6, "cell 1 2"); + + //---- label7 ---- + label7.setIcon(UIManager.getIcon("FileChooser.newFolderIcon")); + add(label7, "cell 1 2"); + + //---- label8 ---- + label8.setIcon(UIManager.getIcon("FileChooser.upFolderIcon")); + add(label8, "cell 1 2"); + + //---- label9 ---- + label9.setIcon(UIManager.getIcon("FileChooser.homeFolderIcon")); + add(label9, "cell 1 2"); + + //---- label10 ---- + label10.setIcon(UIManager.getIcon("FileChooser.detailsViewIcon")); + add(label10, "cell 1 2"); + + //---- label11 ---- + label11.setIcon(UIManager.getIcon("FileChooser.listViewIcon")); + add(label11, "cell 1 2"); // JFormDesigner - End of component initialization //GEN-END:initComponents } diff --git a/flatlaf-core/src/test/java/com/formdev/flatlaf/FlatChooserTest.jfd b/flatlaf-core/src/test/java/com/formdev/flatlaf/FlatChooserTest.jfd index 24cb7847..192f229d 100644 --- a/flatlaf-core/src/test/java/com/formdev/flatlaf/FlatChooserTest.jfd +++ b/flatlaf-core/src/test/java/com/formdev/flatlaf/FlatChooserTest.jfd @@ -9,7 +9,7 @@ new FormModel { add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { "$layoutConstraints": "insets 0,hidemode 3,gap 5 5,ltr" "$columnConstraints": "[][]" - "$rowConstraints": "[top][top]" + "$rowConstraints": "[top][top][]" } ) { name: "this" add( new FormComponent( "javax.swing.JLabel" ) { @@ -34,6 +34,72 @@ new FormModel { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 1" } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label1" + "text": "icons:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label2" + "icon": new com.jformdesigner.model.SwingIcon( 2, "FileView.directoryIcon" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label3" + "icon": new com.jformdesigner.model.SwingIcon( 2, "FileView.fileIcon" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label4" + "icon": new com.jformdesigner.model.SwingIcon( 2, "FileView.computerIcon" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label5" + "icon": new com.jformdesigner.model.SwingIcon( 2, "FileView.hardDriveIcon" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label6" + "icon": new com.jformdesigner.model.SwingIcon( 2, "FileView.floppyDriveIcon" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label7" + "icon": new com.jformdesigner.model.SwingIcon( 2, "FileChooser.newFolderIcon" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label8" + "icon": new com.jformdesigner.model.SwingIcon( 2, "FileChooser.upFolderIcon" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label9" + "icon": new com.jformdesigner.model.SwingIcon( 2, "FileChooser.homeFolderIcon" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label10" + "icon": new com.jformdesigner.model.SwingIcon( 2, "FileChooser.detailsViewIcon" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label11" + "icon": new com.jformdesigner.model.SwingIcon( 2, "FileChooser.listViewIcon" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2" + } ) }, new FormLayoutConstraints( null ) { "location": new java.awt.Point( 0, 0 ) "size": new java.awt.Dimension( 790, 715 ) diff --git a/flatlaf-core/svg/FileChooserDetailsViewIcon.svg b/flatlaf-core/svg/FileChooserDetailsViewIcon.svg index 069275e1..dda96e57 100644 --- a/flatlaf-core/svg/FileChooserDetailsViewIcon.svg +++ b/flatlaf-core/svg/FileChooserDetailsViewIcon.svg @@ -1,8 +1,10 @@ - - - - + + + + + + diff --git a/flatlaf-core/svg/FileChooserListViewIcon.svg b/flatlaf-core/svg/FileChooserListViewIcon.svg index dda96e57..069275e1 100644 --- a/flatlaf-core/svg/FileChooserListViewIcon.svg +++ b/flatlaf-core/svg/FileChooserListViewIcon.svg @@ -1,10 +1,8 @@ - - - - - - + + + +