Java Code Examples for javax.swing.JToolBar#setVisible()

The following examples show how to use javax.swing.JToolBar#setVisible() . 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: WatchAnnotationProvider.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void addActions(JToolBar tb, Action[] actions) {
    tb.removeAll();
    boolean visible = false;
    if (actions != null) {
        for (Action a : actions) {
            if (a != null) {
                JButton btn = tb.add(a);
                btn.setBorder(new javax.swing.border.EmptyBorder(0, 2, 0, 2));
                btn.setBorderPainted(false);
                btn.setContentAreaFilled(false);
                btn.setRolloverEnabled(false);
                btn.setOpaque(false);
                btn.setFocusable(false);
                visible = true;
            } else {
                tb.add(new JSeparator(JSeparator.VERTICAL));
            }
        }
    }
    tb.setVisible(visible);
}
 
Example 2
Source File: TerminalContainerCommon.java    From netbeans with Apache License 2.0 5 votes vote down vote up
protected void initComponents() {
       setLayout(new BorderLayout());

       actionBar = new JToolBar();
       actionBar.setOrientation(JToolBar.VERTICAL);
       actionBar.setLayout(new BoxLayout(actionBar, BoxLayout.Y_AXIS));
       actionBar.setFloatable(false);
       fixSize(actionBar);
       add(actionBar, BorderLayout.WEST);

// Make actionBar initially invisible. setButtons will make it visible
// if actions are defined.
// This will prevent 'blinking' of the toolbar (see IZ 233206)
actionBar.setVisible(false);

       findBar = new FindBar(new FindBar.Owner() {
               
    @Override
           public void close(FindBar fb) {
               findBar.getState().setVisible(false);
               // OLD TerminalContainerImpl.super.remove(findBar);
               componentRemove(findBar);
               validate();
               requestFocus();
           }
       });

   }
 
Example 3
Source File: PipeApplicationBuilder.java    From PIPE with MIT License 5 votes vote down vote up
/**
 *
 * @param pipeComponents
 * @return tool bar involved in animation and all its actions
 */
private JToolBar getAnimationToolBar(PIPEComponents pipeComponents) {
    JToolBar animationToolBar = new JToolBar();
    animationToolBar.setFloatable(false);

    for (GuiAction action : pipeComponents.animateActionManager.getAnimateActions()) {
        addButton(animationToolBar, action);
    }
    animationToolBar.setVisible(false);
    return animationToolBar;
}