Demo: exit even if UI defaults inspector window is shown

This commit is contained in:
Karl Tauber
2020-09-15 13:44:00 +02:00
parent 8c15bc746b
commit ee6a1da709
4 changed files with 19 additions and 5 deletions

View File

@@ -69,6 +69,13 @@ class DemoFrame
} );
}
@Override
public void dispose() {
super.dispose();
System.exit( 0 );
}
private void showHints() {
Hint fontMenuHint = new Hint(
"Use 'Font' menu to increase/decrease font size or try different fonts.",
@@ -109,7 +116,7 @@ class DemoFrame
}
private void exitActionPerformed() {
System.exit( 0 );
dispose();
}
private void aboutActionPerformed() {
@@ -337,7 +344,7 @@ class DemoFrame
//======== this ========
setTitle("FlatLaf Demo");
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
Container contentPane = getContentPane();
contentPane.setLayout(new BorderLayout());

View File

@@ -9,7 +9,7 @@ new FormModel {
add( new FormWindow( "javax.swing.JFrame", new FormLayoutManager( class java.awt.BorderLayout ) ) {
name: "this"
"title": "FlatLaf Demo"
"defaultCloseOperation": 3
"defaultCloseOperation": 2
"$locationPolicy": 2
"$sizePolicy": 2
add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) {

View File

@@ -253,6 +253,13 @@ public class FlatTestFrame
} );
}
@Override
public void dispose() {
super.dispose();
System.exit( 0 );
}
private void updateTitle() {
double systemScaleFactor = UIScale.getSystemScaleFactor( getGraphicsConfiguration() );
float userScaleFactor = UIScale.getUserScaleFactor();
@@ -637,7 +644,7 @@ public class FlatTestFrame
themesPanel = new IJThemesPanel();
//======== this ========
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
Container contentPane = getContentPane();
contentPane.setLayout(new BorderLayout());

View File

@@ -7,7 +7,7 @@ new FormModel {
name: "this"
"$locationPolicy": 2
"$sizePolicy": 2
"defaultCloseOperation": 3
"defaultCloseOperation": 2
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) {
name: "dialogPane"
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {