javax.swing.JToolBar#setOrientation ( )源码实例Demo

下面列出了javax.swing.JToolBar#setOrientation ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: SmartIM   文件: IMPanel.java
private void initUI() {

        JPanel pLeft = new JPanel();
        pLeft.setLayout(new BorderLayout(0, 0));
        JToolBar toolBar1 = new JToolBar();
        toolBar1.setFloatable(false);
        toolBar1.setOrientation(SwingConstants.VERTICAL);
        initToolBar1(toolBar1);
        pLeft.add(toolBar1, BorderLayout.WEST);

        left = createContactsUI();
        left.onLoadContacts(false);
        pLeft.add(left, BorderLayout.CENTER);
        setLeftComponent(pLeft);

        JPanel pRight = new JPanel();
        pRight.setLayout(new BorderLayout(0, 0));

        tabbedChat = new ClosableTabHost(this);
        pRight.add(tabbedChat, BorderLayout.CENTER);

        setRightComponent(pRight);

        setResizeWeight(0.3);
        setDividerLocation(250);
    }
 
源代码2 项目: netbeans   文件: TerminalContainerCommon.java
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();
           }
       });

   }
 
源代码3 项目: arcgis-runtime-demo-java   文件: UI.java
public static JToolBar createToolbar() {
  JToolBar toolbar = new JToolBar();
  toolbar.setBorder(new LineBorder(Color.BLACK, 2));
  toolbar.setFloatable(false);
  toolbar.setOrientation(SwingConstants.VERTICAL);
  toolbar.setBackground(UI.BACKGROUND);
  return toolbar;
}
 
源代码4 项目: arcgis-runtime-demo-java   文件: UI.java
public static JToolBar createToolbar() {
  JToolBar toolbar = new JToolBar();
  toolbar.setBorder(new LineBorder(Color.BLACK, 2));
  toolbar.setFloatable(false);
  toolbar.setOrientation(SwingConstants.VERTICAL);
  toolbar.setBackground(UI.BACKGROUND);
  return toolbar;
}
 
源代码5 项目: ChromeForensics   文件: MainPanel.java
private void initToolBar() {
    toolBar = new JToolBar();
    toolBar.setOrientation(JToolBar.HORIZONTAL);
    toolBar.setFloatable(false);
    toolBar.setPreferredSize(new Dimension(getWidth(), 40));

    manuallyLoadData = new JButton();
    manuallyLoadData.setIcon(Utils.createImageIcon("images/loaddata.png", "Load Data"));
    manuallyLoadData.setToolTipText("Manually locate the chrome data files folder.");
    toolBar.add(manuallyLoadData);

    autoLoadData = new JButton();
    autoLoadData.setIcon(Utils.createImageIcon("images/autosearch.png", "Auto Search and Load Data"));
    autoLoadData.setToolTipText("Automatically search and load chrome files.");
    toolBar.add(autoLoadData);

    toolBar.add(new JToolBar.Separator());

    exportTSV = new JButton("Export to");
    exportTSV.setIcon(Utils.createImageIcon("images/csv.png", "Export results to CSV"));
    exportTSV.setToolTipText("Export Results to CSV");
    exportTSV.setHorizontalTextPosition(SwingConstants.LEFT);
    exportTSV.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent ae) {
            ExportDialog export = new ExportDialog(ExportType.TSV);
            export.setVisible(true);
        }
    });
    toolBar.add(exportTSV);

    exportHTML = new JButton("Export to");
    exportHTML.setIcon(Utils.createImageIcon("images/html.png", "Export results to HTML"));
    exportHTML.setToolTipText("Export results to HTML.");
    exportHTML.setHorizontalTextPosition(SwingConstants.LEFT);
    toolBar.add(exportHTML);

    toolBar.add(new JToolBar.Separator());

    helpButton = new JButton();
    helpButton.setIcon(Utils.createImageIcon("images/help.png", "Need Help? Click Me!"));
    helpButton.setToolTipText("Need Help? Click Me!");
    toolBar.add(helpButton);

    aboutButton = new JButton();
    aboutButton.setIcon(Utils.createImageIcon("images/about.png", "About this tool!"));
    aboutButton.setToolTipText("About this tool!");
    toolBar.add(aboutButton);

    toolBar.add(new JToolBar.Separator());

    exitButton = new JButton();
    exitButton.setIcon(Utils.createImageIcon("images/exit.png", "Exit Application."));
    exitButton.setToolTipText("Exit Application");
    exitButton.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent actionEvent) {
            ChromeForensicsGui.getInstance().dispose();
        }
    });
    toolBar.add(exitButton);
}
 
源代码6 项目: MikuMikuStudio   文件: ImageEditorComponent.java
@SuppressWarnings("unchecked")
private void createToolBar() {
    final JButton zoomIn = new JButton(Icon("zoom-in-2.png"));
    final JButton zoomOut = new JButton(Icon("zoom-out-2.png"));
    final JButton resize = new JButton(Icon("transform-scale-2.png"));
    final JButton rotateLeft = new JButton(Icon("object-rotate-left-2.png"));
    final JButton mirrorX = new JButton(Icon("mirror_x.png"));
    final JButton mirrorY = new JButton(Icon("mirror_y.png"));

    JToolBar toolbar1 = new JToolBar();
    toolbar1.add(zoomIn);
    toolbar1.add(zoomOut);
    toolbar1.addSeparator();
    toolbar1.add(resize);
    toolbar1.add(rotateLeft);
    toolbar1.add(mirrorX);
    toolbar1.add(mirrorY);
    toolbar1.setFloatable(false);
    topContainer.add(toolbar1, BorderLayout.CENTER);

    final ButtonGroup toolsGroup = new ButtonGroup();
    final JToggleButton colorPicker = new JToggleButton(Icon("color-picker.png"));
    final JToggleButton imageCrop = new JToggleButton(Icon("transform-crop.png"));
    toolsGroup.add(colorPicker);
    toolsGroup.add(imageCrop);
    JToolBar toolbar2 = new JToolBar();
    toolbar2.setOrientation(JToolBar.VERTICAL);
    toolbar2.setFloatable(false);
    toolbar2.add(colorPicker);
    toolbar2.add(imageCrop);
    COMPONENT.add(toolbar2, BorderLayout.WEST);

    ActionListener al = new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            Object source = e.getSource();
            if (source == zoomIn) {
                setScaleFactor(getScaleFactor() + 0.1f);
            } else if (source == zoomOut) {
                setScaleFactor(getScaleFactor() - 0.1f);
            } else if (source == resize) {
                querySizeAndResize();
            } else if (source == rotateLeft) {
                editedImage = RotateLeftFilter.create().filter(editedImage);
                resizeDisplay();
                enableSaving();
            } else if (source == mirrorX) {
                editedImage = MirrorFilter.create().filter(editedImage, MirrorFilter.X);
                resizeDisplay();
                enableSaving();
            } else if (source == mirrorY) {
                editedImage = MirrorFilter.create().filter(editedImage, MirrorFilter.Y);
                resizeDisplay();
                enableSaving();
            } else if (source == colorPicker) {
                setCurrentTool(ColorPicker.create());
            } else if (source == imageCrop) {
                setCurrentTool(CropTool.create());
            }
           
        }
    };
    for (AbstractButton b : Arrays.asList(zoomIn, zoomOut, resize, /*save, saveAs,*/
            rotateLeft, mirrorX, mirrorY, colorPicker, imageCrop)) {
        b.addActionListener(al);
    }
}
 
源代码7 项目: netbeans   文件: JComponentBuilders.java
protected void setupInstance(JToolBar instance) {
    super.setupInstance(instance);
    
    instance.setBorderPainted(paintBorder);
    
    if (margin != null) instance.setMargin(margin.createInstance());
    
    instance.setFloatable(floatable);
    instance.setOrientation(orientation);
}
 
源代码8 项目: visualvm   文件: JComponentBuilders.java
protected void setupInstance(JToolBar instance) {
    super.setupInstance(instance);
    
    instance.setBorderPainted(paintBorder);
    
    if (margin != null) instance.setMargin(margin.createInstance());
    
    instance.setFloatable(floatable);
    instance.setOrientation(orientation);
}
 
源代码9 项目: ramus   文件: DockBoundary.java
/**
 * Inserts the specified toolbar into this boundary at the provided indices.
 * Subclasses generally should not override this method, but may provide
 * more detailed behavior by overriding the toolBarAdded() callback method
 * instead.
 */
public void addToolBar(final JToolBar toolbar, final int rowIndex, final int index) {
    toolbar.setOrientation(ourOrientation);
    ourToolBars.add(toolbar);
    toolBarAdded(toolbar, rowIndex, index);
}