当前位置: 首页>>代码示例>>Java>>正文


Java JToolBar.HORIZONTAL属性代码示例

本文整理汇总了Java中javax.swing.JToolBar.HORIZONTAL属性的典型用法代码示例。如果您正苦于以下问题:Java JToolBar.HORIZONTAL属性的具体用法?Java JToolBar.HORIZONTAL怎么用?Java JToolBar.HORIZONTAL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.swing.JToolBar的用法示例。


在下文中一共展示了JToolBar.HORIZONTAL属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: MainToolBar

MainToolBar(@NonNull final Pair<JComponent,GridBagConstraints>... components) {
    super(BoxLayout.X_AXIS);
    setBorder(BorderFactory.createEmptyBorder(1, 2, 1, 5));
    final JToolBar toolbar = new NoBorderToolBar(JToolBar.HORIZONTAL);
    toolbar.setFloatable(false);
    toolbar.setRollover(true);
    toolbar.setBorderPainted(false);
    toolbar.setBorder(BorderFactory.createEmptyBorder());
    toolbar.setOpaque(false);
    toolbar.setFocusable(false);
    toolbar.setLayout(new GridBagLayout());
    for (Pair<JComponent,GridBagConstraints> p : components) {
        toolbar.add(p.first(),p.second());
    }
    add (toolbar);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:HierarchyTopComponent.java

示例2: initPanel

private void initPanel() {
    setBorder(new EmptyBorder(1, 2, 1, 2));

    // configure toolbar
    toolbar = new NoBorderToolBar(JToolBar.HORIZONTAL);
    toolbar.setFloatable(false);
    toolbar.setRollover(true);
    toolbar.setBorderPainted(false);
    toolbar.setBorder(BorderFactory.createEmptyBorder());
    toolbar.setOpaque(false);
    toolbar.setFocusable(false);

    add(toolbar);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:CustomToolbar.java

示例3: initPanel

/** Called only from AWT */
private void initPanel () {
    setBorder(new EmptyBorder(1, 2, 3, 5));

    // configure toolbar
    JToolBar toolbar = new JToolBar(JToolBar.HORIZONTAL);
    toolbar.setFloatable(false);
    toolbar.setRollover(true);
    toolbar.setBorderPainted(false);
    // create toggle buttons
    int filterCount = filtersDesc.getFilterCount();
    toggles = new ArrayList<JToggleButton>(filterCount);
    JToggleButton toggleButton = null;
    
    Map<String,Boolean> fStates = new HashMap<String, Boolean>(filterCount * 2);

    for (int i = 0; i < filterCount; i++) {
        toggleButton = createToggle(fStates, i);
        toggles.add(toggleButton);
    }
    
    // add toggle buttons
    JToggleButton curToggle;
    Dimension space = new Dimension(3, 0);
    for (int i = 0; i < toggles.size(); i++) {
        curToggle = toggles.get(i);
        curToggle.addActionListener(this);
        toolbar.add(curToggle);
        if (i != toggles.size() - 1) {
            toolbar.addSeparator(space);
        }
    }
    
    add(toolbar);
    
    // initialize member states map
    synchronized (STATES_LOCK) {
        filterStates = fStates;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:40,代码来源:FiltersManager.java

示例4: createActionsToolbar

private static JToolBar createActionsToolbar() {
    JToolBar jt = new JToolBar(JToolBar.HORIZONTAL);
    jt.setBorder(new EmptyBorder(0, 0, 0, 0));
    jt.setFloatable(false);
    jt.setRollover(false);
    return jt;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:WatchAnnotationProvider.java

示例5: init

@Override
public Resource init() {
  setLayout(new BorderLayout());

  text.setEditable(false);

  add(text, BorderLayout.CENTER);

  JButton btnRefresh = new JButton("Refresh", MainFrame.getIcon("Refresh"));
  btnRefresh.addActionListener(new ActionListener() {

    @Override
    public void actionPerformed(ActionEvent arg0) {
      refresh();
    }
  });

  JToolBar toolbar = new JToolBar(JToolBar.HORIZONTAL);
  toolbar.setFloatable(false);

  toolbar.add(btnRefresh);
  toolbar.addSeparator();
  toolbar.add(new JLabel("Currently this view is not automatically updated"));

  // not currently need as we now support the listners properly
  // add(toolbar, BorderLayout.NORTH);

  return this;
}
 
开发者ID:GateNLP,项目名称:gate-core,代码行数:29,代码来源:RelationSetView.java

示例6: createSettingsBar

/**
 * Creates an instance of JToolBar {@link #settingsBar} and adds {@link #zoomInButton}, {@link #zoomOutButton}, {@link #showICFGButton}, {@link #colorSettingsButton}, {@link #panLeftButton}, {@link #panRightButton}, {@link #panUpButton}, {@link #panDownButton}, {@link #searchTextField} components to it.
 * @author Shashank B S
 */
private void createSettingsBar() {
	settingsBar = new JToolBar("ControlsBar", JToolBar.HORIZONTAL);

	settingsBar.add(zoomInButton);
	settingsBar.add(zoomOutButton);
	settingsBar.add(showICFGButton);
	settingsBar.add(colorSettingsButton);
	settingsBar.add(panLeftButton);
	settingsBar.add(panRightButton);
	settingsBar.add(panUpButton);
	settingsBar.add(panDownButton);
	settingsBar.add(searchTextField);
}
 
开发者ID:VisuFlow,项目名称:visuflow-plugin,代码行数:17,代码来源:GraphManager.java

示例7: initPanel

/** Called only from AWT */
private void initPanel () {
    setBorder(new EmptyBorder(1, 2, 3, 5));

    // configure toolbar
    toolbar = new NoBorderToolBar(JToolBar.HORIZONTAL);
    toolbar.setFloatable(false);
    toolbar.setRollover(true);            
    toolbar.setBorderPainted(false);
    toolbar.setBorder(BorderFactory.createEmptyBorder());
    toolbar.setOpaque(false);
    toolbar.setFocusable(false);
    // create toggle buttons
    int filterCount = filtersDesc.getFilterCount();
    toggles = new ArrayList<JToggleButton>(filterCount);
    JToggleButton toggleButton = null;
    
    Map<String,Boolean> fStates = new HashMap<String, Boolean>(filterCount * 2);

    for (int i = 0; i < filterCount; i++) {
        toggleButton = createToggle(fStates, i);
        toggles.add(toggleButton);
    }
    
    // add toggle buttons
    JToggleButton curToggle;
    for (int i = 0; i < toggles.size(); i++) {
        curToggle = toggles.get(i);
        curToggle.addActionListener(this);
        toolbar.add(curToggle);
        if (i != toggles.size() - 1) {
            toolbar.add(new Space());
        }
    }
    
    add(toolbar);
    
    // initialize member states map
    synchronized (STATES_LOCK) {
        filterStates = fStates;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:42,代码来源:FiltersManager.java

示例8: ControlsToolbar

public ControlsToolbar() {
    super( JToolBar.HORIZONTAL );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:3,代码来源:ControlsToolbar.java


注:本文中的javax.swing.JToolBar.HORIZONTAL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。