mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 22:47:13 -06:00
InternalFrame: use default icon in internal frames (issue #122)
This commit is contained in:
@@ -7,6 +7,7 @@ package com.formdev.flatlaf.testing;
|
||||
import java.awt.*;
|
||||
import java.beans.PropertyVetoException;
|
||||
import javax.swing.*;
|
||||
import com.formdev.flatlaf.extras.TriStateCheckBox;
|
||||
import com.formdev.flatlaf.icons.FlatFileViewFloppyDriveIcon;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import net.miginfocom.swing.*;
|
||||
@@ -50,8 +51,10 @@ public class FlatInternalFrameTest
|
||||
maximizableCheckBox.isSelected(),
|
||||
iconifiableCheckBox.isSelected() );
|
||||
|
||||
if( iconCheckBox.isSelected() )
|
||||
if( iconCheckBox.getState() == TriStateCheckBox.State.SELECTED )
|
||||
internalFrame.setFrameIcon( new FlatFileViewFloppyDriveIcon() );
|
||||
else if( iconCheckBox.getState() == TriStateCheckBox.State.UNSELECTED )
|
||||
internalFrame.setFrameIcon( null );
|
||||
|
||||
if( menuBarCheckBox.isSelected() ) {
|
||||
JMenuBar menuBar = new JMenuBar();
|
||||
@@ -100,7 +103,7 @@ public class FlatInternalFrameTest
|
||||
closableCheckBox = new JCheckBox();
|
||||
iconifiableCheckBox = new JCheckBox();
|
||||
maximizableCheckBox = new JCheckBox();
|
||||
iconCheckBox = new JCheckBox();
|
||||
iconCheckBox = new TriStateCheckBox();
|
||||
menuBarCheckBox = new JCheckBox();
|
||||
titleLabel = new JLabel();
|
||||
titleField = new JTextField();
|
||||
@@ -192,7 +195,7 @@ public class FlatInternalFrameTest
|
||||
private JCheckBox closableCheckBox;
|
||||
private JCheckBox iconifiableCheckBox;
|
||||
private JCheckBox maximizableCheckBox;
|
||||
private JCheckBox iconCheckBox;
|
||||
private TriStateCheckBox iconCheckBox;
|
||||
private JCheckBox menuBarCheckBox;
|
||||
private JLabel titleLabel;
|
||||
private JTextField titleField;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
JFDML JFormDesigner: "7.0.0.0.194" Java: "13.0.1" encoding: "UTF-8"
|
||||
JFDML JFormDesigner: "7.0.2.0.298" Java: "14" encoding: "UTF-8"
|
||||
|
||||
new FormModel {
|
||||
contentType: "form/swing"
|
||||
@@ -50,7 +50,7 @@ new FormModel {
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 1,alignx left,growx 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||
add( new FormComponent( "com.formdev.flatlaf.extras.TriStateCheckBox" ) {
|
||||
name: "iconCheckBox"
|
||||
"text": "Frame icon"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
|
||||
Reference in New Issue
Block a user