Java Code Examples for javax.swing.JMenuBar#setAlignmentX()

The following examples show how to use javax.swing.JMenuBar#setAlignmentX() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UI.java    From arcgis-runtime-demo-java with Apache License 2.0 5 votes vote down vote up
public static JMenuBar createMenuBar(JMenu menuAdd, JButton btnEdit, JButton btnQuery) {
  JMenuBar menuBar = new JMenuBar();
    menuBar.setFont(UI.FONT);
    menuBar.setBackground(UI.BACKGROUND);
    menuBar.setLayout(new FlowLayout());
    menuBar.setAlignmentX(Component.CENTER_ALIGNMENT);
    menuBar.add(menuAdd);
    menuBar.add(new JSeparator());
    menuBar.add(btnEdit);
    menuBar.add(new JSeparator());
    menuBar.add(btnQuery);
    return menuBar;
}
 
Example 2
Source File: UI.java    From arcgis-runtime-demo-java with Apache License 2.0 5 votes vote down vote up
public static JMenuBar createMenuBar(JMenu menuAdd, JButton btnEdit, JButton btnQuery) {
  JMenuBar menuBar = new JMenuBar();
    menuBar.setFont(UI.FONT);
    menuBar.setBackground(UI.BACKGROUND);
    menuBar.setLayout(new FlowLayout());
    menuBar.setAlignmentX(Component.CENTER_ALIGNMENT);
    menuBar.add(menuAdd);
    menuBar.add(new JSeparator());
    menuBar.add(btnEdit);
    menuBar.add(new JSeparator());
    menuBar.add(btnQuery);
    return menuBar;
}