mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-12 06:57:13 -06:00
Menus: on Windows, releasing Alt key now activates the menu bar (issue #43)
This commit is contained in:
@@ -56,6 +56,10 @@ public class FlatMnemonicsTest
|
||||
SwingUtilities.windowForComponent( this ).repaint();
|
||||
}
|
||||
|
||||
private void openDialog() {
|
||||
JOptionPane.showMessageDialog( this, new FlatMnemonicsTest() );
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
|
||||
JLabel label1 = new JLabel();
|
||||
@@ -77,6 +81,7 @@ public class FlatMnemonicsTest
|
||||
JPanel panel3 = new JPanel();
|
||||
JLabel label5 = new JLabel();
|
||||
alwaysShowMnemonicsCheckBox = new JCheckBox();
|
||||
JButton button2 = new JButton();
|
||||
menuBar = new JMenuBar();
|
||||
JMenu fileMenu = new JMenu();
|
||||
JMenuItem newMenuItem = new JMenuItem();
|
||||
@@ -114,7 +119,7 @@ public class FlatMnemonicsTest
|
||||
// columns
|
||||
"[fill]" +
|
||||
"[150,fill]para" +
|
||||
"[grow,fill]",
|
||||
"[300,grow,fill]",
|
||||
// rows
|
||||
"[]" +
|
||||
"[]" +
|
||||
@@ -238,6 +243,11 @@ public class FlatMnemonicsTest
|
||||
alwaysShowMnemonicsCheckBox.addActionListener(e -> alwaysShowMnemonicsChanged());
|
||||
add(alwaysShowMnemonicsCheckBox, "cell 0 7 2 1,alignx left,growx 0");
|
||||
|
||||
//---- button2 ----
|
||||
button2.setText("Open Dialog");
|
||||
button2.addActionListener(e -> openDialog());
|
||||
add(button2, "cell 2 7,alignx left,growx 0");
|
||||
|
||||
//======== menuBar ========
|
||||
{
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ new FormModel {
|
||||
}
|
||||
add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||
"$layoutConstraints": "ltr,insets dialog,hidemode 3"
|
||||
"$columnConstraints": "[fill][150,fill]para[grow,fill]"
|
||||
"$columnConstraints": "[fill][150,fill]para[300,grow,fill]"
|
||||
"$rowConstraints": "[][][][][]para[][]para[]"
|
||||
} ) {
|
||||
name: "this"
|
||||
@@ -141,6 +141,13 @@ new FormModel {
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 7 2 1,alignx left,growx 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JButton" ) {
|
||||
name: "button2"
|
||||
"text": "Open Dialog"
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "openDialog", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 7,alignx left,growx 0"
|
||||
} )
|
||||
}, new FormLayoutConstraints( null ) {
|
||||
"location": new java.awt.Point( 0, 0 )
|
||||
"size": new java.awt.Dimension( 790, 380 )
|
||||
|
||||
Reference in New Issue
Block a user