當前位置: 首頁>>代碼示例>>Java>>正文


Java JToolBar.VERTICAL屬性代碼示例

本文整理匯總了Java中javax.swing.JToolBar.VERTICAL屬性的典型用法代碼示例。如果您正苦於以下問題:Java JToolBar.VERTICAL屬性的具體用法?Java JToolBar.VERTICAL怎麽用?Java JToolBar.VERTICAL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在javax.swing.JToolBar的用法示例。


在下文中一共展示了JToolBar.VERTICAL屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initComponents

private void initComponents() {
    setLayout (new BorderLayout ());
    contentComponent = new javax.swing.JPanel(new BorderLayout ());
    add (contentComponent, BorderLayout.CENTER);  //NOI18N
    JToolBar toolBar = new JToolBar(JToolBar.VERTICAL);
    toolBar.setFloatable(false);
    toolBar.setRollover(true);
    toolBar.setBorderPainted(true);
    if( "Aqua".equals(UIManager.getLookAndFeel().getID()) ) { //NOI18N
        toolBar.setBackground(UIManager.getColor("NbExplorerView.background")); //NOI18N
    }
    toolBar.setBorder(javax.swing.BorderFactory.createCompoundBorder(
            javax.swing.BorderFactory.createMatteBorder(0, 0, 0, 1,
            javax.swing.UIManager.getDefaults().getColor("Separator.background")),
            javax.swing.BorderFactory.createMatteBorder(0, 0, 0, 1,
            javax.swing.UIManager.getDefaults().getColor("Separator.foreground"))));
    add(toolBar, BorderLayout.WEST);
    JComponent buttonsPane = toolBar;
    viewModelListener = new ViewModelListener (
        name,
        contentComponent,
        buttonsPane,
        propertiesHelpID,
        ImageUtilities.loadImage(icon)
    );
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:26,代碼來源:ViewComponent.java

示例2: initToolBar

/**
 * Initialize toolbar.
 */
private void initToolBar() {
    toolbar = new JToolBar(JToolBar.VERTICAL);
    toolbar.setFloatable(false);
    add(toolbar, BorderLayout.WEST);
    
    JButton button = makeButton("save", SAVE, "Save", "Save");
    toolbar.add(button);

    button = makeButton("print", PRINT, "Print", "Print");
    toolbar.add(button);
}
 
開發者ID:takun2s,項目名稱:smile_1.5.0_java7,代碼行數:14,代碼來源:PlotPanel.java

示例3: initPanel

/**
         * Called only from AWT
         */
        private void initPanel() {
            // configure toolbar
            toolbar = new ToolbarWithOverflow(JToolBar.VERTICAL);
            toolbar.setFloatable(false);
            toolbar.setRollover(true);
            toolbar.setBorderPainted(true);
            toolbar.setBorder(
                    javax.swing.BorderFactory.createCompoundBorder(
                    javax.swing.BorderFactory.createMatteBorder(0, 1, 0, 0,
                    javax.swing.UIManager.getDefaults().getColor("Separator.foreground")), //NOI18N
                    javax.swing.BorderFactory.createEmptyBorder(0, 1, 0, 0)));
            if ("Aqua".equals(UIManager.getLookAndFeel().getID())) { //NOI18N
                toolbar.setBackground(UIManager.getColor("NbExplorerView.background"));
            }
//            toolbar.setFocusable(false);
            // create toggle buttons
            int filterCount = filtersDesc.getFilterCount();
            toggles = new ArrayList<JToggleButton>(filterCount);
            JToggleButton toggleButton;

            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);
            }

            // initialize member states map
            synchronized (STATES_LOCK) {
                filterStates = fStates;
            }
        }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:43,代碼來源:FiltersManagerImpl.java


注:本文中的javax.swing.JToolBar.VERTICAL屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。