mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-15 16:27:13 -06:00
Demo: added "Options > Smooth Scrolling" to menu (issue #50)
This commit is contained in:
@@ -266,6 +266,10 @@ class DemoFrame
|
|||||||
repaint();
|
repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void smoothScrollingChanged() {
|
||||||
|
UIManager.put( "ScrollPane.smoothScrolling", smoothScrollingMenuItem.isSelected() );
|
||||||
|
}
|
||||||
|
|
||||||
private void animatedLafChangeChanged() {
|
private void animatedLafChangeChanged() {
|
||||||
System.setProperty( "flatlaf.animatedLafChange", String.valueOf( animatedLafChangeMenuItem.isSelected() ) );
|
System.setProperty( "flatlaf.animatedLafChange", String.valueOf( animatedLafChangeMenuItem.isSelected() ) );
|
||||||
}
|
}
|
||||||
@@ -505,6 +509,7 @@ class DemoFrame
|
|||||||
showTitleBarIconMenuItem = new JCheckBoxMenuItem();
|
showTitleBarIconMenuItem = new JCheckBoxMenuItem();
|
||||||
underlineMenuSelectionMenuItem = new JCheckBoxMenuItem();
|
underlineMenuSelectionMenuItem = new JCheckBoxMenuItem();
|
||||||
alwaysShowMnemonicsMenuItem = new JCheckBoxMenuItem();
|
alwaysShowMnemonicsMenuItem = new JCheckBoxMenuItem();
|
||||||
|
smoothScrollingMenuItem = new JCheckBoxMenuItem();
|
||||||
animatedLafChangeMenuItem = new JCheckBoxMenuItem();
|
animatedLafChangeMenuItem = new JCheckBoxMenuItem();
|
||||||
JMenuItem showHintsMenuItem = new JMenuItem();
|
JMenuItem showHintsMenuItem = new JMenuItem();
|
||||||
JMenuItem showUIDefaultsInspectorMenuItem = new JMenuItem();
|
JMenuItem showUIDefaultsInspectorMenuItem = new JMenuItem();
|
||||||
@@ -793,6 +798,12 @@ class DemoFrame
|
|||||||
alwaysShowMnemonicsMenuItem.addActionListener(e -> alwaysShowMnemonics());
|
alwaysShowMnemonicsMenuItem.addActionListener(e -> alwaysShowMnemonics());
|
||||||
optionsMenu.add(alwaysShowMnemonicsMenuItem);
|
optionsMenu.add(alwaysShowMnemonicsMenuItem);
|
||||||
|
|
||||||
|
//---- smoothScrollingMenuItem ----
|
||||||
|
smoothScrollingMenuItem.setText("Smooth Scrolling");
|
||||||
|
smoothScrollingMenuItem.setSelected(true);
|
||||||
|
smoothScrollingMenuItem.addActionListener(e -> smoothScrollingChanged());
|
||||||
|
optionsMenu.add(smoothScrollingMenuItem);
|
||||||
|
|
||||||
//---- animatedLafChangeMenuItem ----
|
//---- animatedLafChangeMenuItem ----
|
||||||
animatedLafChangeMenuItem.setText("Animated Laf Change");
|
animatedLafChangeMenuItem.setText("Animated Laf Change");
|
||||||
animatedLafChangeMenuItem.setSelected(true);
|
animatedLafChangeMenuItem.setSelected(true);
|
||||||
@@ -981,6 +992,7 @@ class DemoFrame
|
|||||||
private JCheckBoxMenuItem showTitleBarIconMenuItem;
|
private JCheckBoxMenuItem showTitleBarIconMenuItem;
|
||||||
private JCheckBoxMenuItem underlineMenuSelectionMenuItem;
|
private JCheckBoxMenuItem underlineMenuSelectionMenuItem;
|
||||||
private JCheckBoxMenuItem alwaysShowMnemonicsMenuItem;
|
private JCheckBoxMenuItem alwaysShowMnemonicsMenuItem;
|
||||||
|
private JCheckBoxMenuItem smoothScrollingMenuItem;
|
||||||
private JCheckBoxMenuItem animatedLafChangeMenuItem;
|
private JCheckBoxMenuItem animatedLafChangeMenuItem;
|
||||||
private JMenuItem aboutMenuItem;
|
private JMenuItem aboutMenuItem;
|
||||||
private JToolBar toolBar;
|
private JToolBar toolBar;
|
||||||
|
|||||||
@@ -418,6 +418,15 @@ new FormModel {
|
|||||||
}
|
}
|
||||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "alwaysShowMnemonics", false ) )
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "alwaysShowMnemonics", false ) )
|
||||||
} )
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) {
|
||||||
|
name: "smoothScrollingMenuItem"
|
||||||
|
"text": "Smooth Scrolling"
|
||||||
|
"selected": true
|
||||||
|
auxiliary() {
|
||||||
|
"JavaCodeGenerator.variableLocal": false
|
||||||
|
}
|
||||||
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "smoothScrollingChanged", false ) )
|
||||||
|
} )
|
||||||
add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) {
|
add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) {
|
||||||
name: "animatedLafChangeMenuItem"
|
name: "animatedLafChangeMenuItem"
|
||||||
"text": "Animated Laf Change"
|
"text": "Animated Laf Change"
|
||||||
|
|||||||
Reference in New Issue
Block a user