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


Java JToolBar.setFloatable方法代码示例

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


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

示例1: initComponents

import javax.swing.JToolBar; //导入方法依赖的package包/类
protected void initComponents() {
  multipleButtons = new ArrayList<JButton>();
  controls = new JPanel(new BorderLayout());
  statusLabel = new JLabel(""); //$NON-NLS-1$
  statusLabel.setForeground(Color.BLUE);
  slotPanel = new JPanel();
  toolbar = new JToolBar();
  toolbar.setFloatable(false);
  toolbar.setLayout(new BoxLayout(toolbar, BoxLayout.Y_AXIS));
  addRowButton = addButton(addRowButtonText);
  multipleButtons.add(addRowButton);
  addColumnButton = addButton(addColumnButtonText);
  multipleButtons.add(addColumnButton);
  clearButton = addButton(Resources.getString("BoardPicker.clear")); //$NON-NLS-1$
  multipleButtons.add(clearButton);
  setAllowMultiple(allowMultiple);
  controls.add(BorderLayout.NORTH, statusLabel);
  JPanel pp = new JPanel();
  pp.add(toolbar);
  controls.add(BorderLayout.WEST, pp);
  slotScroll = new JScrollPane(slotPanel);
  controls.add(BorderLayout.CENTER, slotScroll);
  reset();
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:25,代码来源:BoardPicker.java

示例2: ImageTopComponent

import javax.swing.JToolBar; //导入方法依赖的package包/类
ImageTopComponent(Image image, String className, int instanceNumber) {
    setName(BrowserUtils.getSimpleType(className) + "#" + instanceNumber);
    setToolTipText("Preview of " + className + "#" + instanceNumber);
    setLayout(new BorderLayout());

    int width = image.getWidth(null);
    int height = image.getHeight(null);
    BufferedImage displayedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
    Graphics g = displayedImage.createGraphics();
    drawChecker(g, 0, 0, width, height);
    g.drawImage(image, 0, 0, null);

    JComponent c = new JScrollPane(new JLabel(new ImageIcon(displayedImage)));
    add(c, BorderLayout.CENTER);


    JToolBar toolBar = new JToolBar();
    toolBar.putClientProperty("JToolBar.isRollover", Boolean.TRUE); //NOI18N
    toolBar.setFloatable(false);
    toolBar.setName(Bundle.ImageDetailProvider_Toolbar());

    //JButton button = new JButton();
    //button.setText("");
    toolBar.add(new ImageExportAction(image));
    add(toolBar, BorderLayout.NORTH);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:ImageDetailProvider.java

示例3: createWorkspaceToolBar

import javax.swing.JToolBar; //导入方法依赖的package包/类
public void createWorkspaceToolBar() {
    JToolBar workspaceToolBar = new JToolBar();
    workspaceToolBar.setFloatable(false);
    for (ActionDescriptor descriptor : getActionDescriptors()) {
        final Action action = descriptor.getAction();
        if (action instanceof ShowWorkspaceAction) {
            JToggleButton button = new JToggleButton(action);
            button.setText(cut((String) action
                    .getValue(Action.ACTION_COMMAND_KEY)));
            button.setToolTipText((String) action
                    .getValue(Action.ACTION_COMMAND_KEY));
            button.addActionListener(new java.awt.event.ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    action.actionPerformed(e);
                }
            });
            button.setFocusable(false);
            workspaceToolBar.add(button);
        }
    }
    factory.setNorthEastCornerComponent(workspaceToolBar);
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:24,代码来源:ShowWorkspacePlugin.java

示例4: initComponents

import javax.swing.JToolBar; //导入方法依赖的package包/类
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,代码行数:27,代码来源:ViewComponent.java

示例5: createFilterToolBar

import javax.swing.JToolBar; //导入方法依赖的package包/类
private JToolBar createFilterToolBar() {
    final FiltersDescriptor filtersDesc = FiltersDescriptor.getInstance();
    // configure toolbar
    final JToolBar toolbar = new NoBorderToolBar();
    toolbar.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
    toolbar.setFloatable(false);
    //toolbar.setRollover(true);
    toolbar.setBorderPainted(false);
    toolbar.setOpaque(false);
    if( "Aqua".equals(UIManager.getLookAndFeel().getID()) ) { //NOI18N
        toolbar.setBackground(UIManager.getColor("NbExplorerView.background")); //NOI18N
    }
    createFilterToolBarUI(toolbar, filtersDesc);
    filtersDesc.addPropertyChangeListener(new PropertyChangeListener() {
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    createFilterToolBarUI(toolbar, filtersDesc);
                }
            });
        }
    });
    return toolbar;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:InfoPanel.java

示例6: getRTreeInPanel

import javax.swing.JToolBar; //导入方法依赖的package包/类
private JPanel getRTreeInPanel(String labelText, JTree tree) {
    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());

    JToolBar toolBar = new JToolBar();
    toolBar.setFloatable(false);
    toolBar.setBorder(BorderFactory.createEtchedBorder());
    reusableSwitch = new JButton(labelText);
    reusableSwitch.setFont(new Font("Default", Font.BOLD, 12));
    reusableSwitch.setContentAreaFilled(false);

    toolBar.add(new javax.swing.Box.Filler(new java.awt.Dimension(10, 0),
            new java.awt.Dimension(10, 0),
            new java.awt.Dimension(10, 32767)));
    toolBar.add(reusableSwitch);
    toolBar.setPreferredSize(new java.awt.Dimension(toolBar.getPreferredSize().width, 30));

    panel.add(toolBar, BorderLayout.NORTH);
    panel.add(TreeSearch.installFor(tree), BorderLayout.CENTER);
    return panel;
}
 
开发者ID:CognizantQAHub,项目名称:Cognizant-Intelligent-Test-Scripter,代码行数:22,代码来源:TestDesignUI.java

示例7: QualifierSourceSelectPanel

import javax.swing.JToolBar; //导入方法依赖的package包/类
public QualifierSourceSelectPanel(GUIFramework framework,
                                  Qualifier qualifier, QualifierSource qualifierSource, SelectType selectType) {
    super(new BorderLayout());
    this.qualifierSource = qualifierSource;
    view = new SelectableTableView(framework, qualifier) {

    };

    this.add(view.createComponent(), BorderLayout.CENTER);

    view.setSelectType(selectType);
    List<ElementSource> sources = qualifierSource.getElementSources();
    List<Long> rows = new ArrayList<Long>(sources.size());
    for (ElementSource source : sources) {
        rows.add(source.getElement().getId());
    }
    view.selectRows(rows);

    JToolBar toolBar = view.createToolBar();
    this.add(toolBar, BorderLayout.NORTH);
    toolBar.setFloatable(false);
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:23,代码来源:QualifierSourceSelectPanel.java

示例8: addSwitchViewButton

import javax.swing.JToolBar; //导入方法依赖的package包/类
/**
 * Adds the switchView button the the panel
 * 
 * @param gbc
 *          - the constraints used for this component
 */
private void addSwitchViewButton(GridBagConstraints gbc) {
	gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
			UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
	gbc.anchor = GridBagConstraints.EAST;
	gbc.fill = GridBagConstraints.NONE;
	gbc.gridx = 2;
	gbc.gridy = 0;
	gbc.weightx = 0;
	gbc.weighty = 0;
	JToolBar toolbar = new JToolBar();
	switchViewButton = new ToolbarButton(null, false);
	switchViewButton.setToolTipText(translator.getTranslation(Tags.CHANGE_TREE_VIEW_BUTTON_TOOLTIP));
	URL resource = currentViewMode == ResourcesViewMode.FLAT_VIEW 
	    ? getClass().getResource(ImageConstants.TREE_VIEW)
	    : getClass().getResource(ImageConstants.TABLE_VIEW);
	if (resource != null) {
	  ImageIcon icon = (ImageIcon) imageUtilities.loadIcon(resource);
	  switchViewButton.setIcon(icon);
	}
	toolbar.add(switchViewButton);
	toolbar.setFloatable(false);
	toolbar.setOpaque(false);
	this.add(toolbar, gbc);

}
 
开发者ID:oxygenxml,项目名称:oxygen-git-plugin,代码行数:32,代码来源:ChangesPanel.java

示例9: initPanel

import javax.swing.JToolBar; //导入方法依赖的package包/类
/** 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,代码行数:41,代码来源:FiltersManager.java

示例10: MainPanel

import javax.swing.JToolBar; //导入方法依赖的package包/类
public MainPanel(Backend backend, Parameters params)
{
	this.backend = backend;
	fileList = new FileListPanel(backend);
	fileList.setBorder(BorderFactory.createLineBorder(Color.BLACK, 1));

	toolBar = new JToolBar();
	toolBar.setLayout(new ExpandLayout()
	{
		@Override
		public Component createComponent(Action a)
		{
			return new JButton(a);
		}
	});
	toolBar.setFloatable(false);
	toolBar.setRollover(true);

	setupActions(params);

	setLayout(new BorderLayout());
	add(toolBar, BorderLayout.NORTH);
	add(fileList, BorderLayout.CENTER);

	// TODO: Temporary
	FileInfo root = new FileInfo();
	root.setDirectory(true);
	fileList.setCwd(root);
}
 
开发者ID:equella,项目名称:Equella,代码行数:30,代码来源:MainPanel.java

示例11: initComponents

import javax.swing.JToolBar; //导入方法依赖的package包/类
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();
           }
       });

   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:TerminalContainerCommon.java

示例12: createToolbar

import javax.swing.JToolBar; //导入方法依赖的package包/类
/**
     */
    private JComponent createToolbar() {
        createShowButtons();
        createNextPrevFailureButtons();
        createRerunButtons();
	createOptionButtons();
        String testingFramework = Manager.getInstance().getTestingFramework();

        JToolBar toolbar = new ToolbarWithOverflow(SwingConstants.VERTICAL);
        toolbar.add(rerunButton);
        toolbar.add(rerunFailedButton);
        toolbar.add(new JToolBar.Separator());
        toolbar.add(btnShowPassed);
        if(testingFramework.equals(Manager.TESTNG_TF)) {
            toolbar.add(btnShowPassedWithErrors);
        }
        toolbar.add(btnShowFailed);
        toolbar.add(btnShowError);
        toolbar.add(btnShowAborted);
//        if(testingFramework.equals(Manager.TESTNG_TF) || testingFramework.equals(Manager.JUNIT_TF)) {
//            toolbar.add(btnShowIgnored);
//        }
        toolbar.add(btnShowSkipped);
	
        toolbar.add(new JToolBar.Separator());
        toolbar.add(previousFailure);
        toolbar.add(nextFailure);
        toolbar.add(new JToolBar.Separator());
        toolbar.add(btnAlwaysOpenTRW);
	toolbar.add(btnAlwaysOpenNewTab);
        
        toolbar.setFocusable(false);
        toolbar.setRollover(true);
        toolbar.setFloatable(false);
        return toolbar;
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:38,代码来源:StatisticsPanel.java

示例13: getToolbar

import javax.swing.JToolBar; //导入方法依赖的package包/类
private JToolBar getToolbar() {
    JToolBar tbar = new javax.swing.JToolBar();
    tbar.setFloatable(false);
    tbar.setRollover(true);
    tbar.setBorderPainted(false);
    return tbar;
}
 
开发者ID:CognizantQAHub,项目名称:Cognizant-Intelligent-Test-Scripter,代码行数:8,代码来源:JSList.java

示例14: createToolBar

import javax.swing.JToolBar; //导入方法依赖的package包/类
private Component createToolBar() {
    JToolBar bar = new JToolBar();
    bar.setFloatable(false);
    for (Action action : getActions())
        if (action == null)
            bar.addSeparator();
        else
            bar.add(action).setFocusable(false);
    return bar;
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:11,代码来源:QualifierPreferencesPanel.java

示例15: createToolBar

import javax.swing.JToolBar; //导入方法依赖的package包/类
private Component createToolBar(Action[] actions) {
    JToolBar bar = new JToolBar();
    bar.setFloatable(false);
    for (Action action : actions) {
        if (action == null)
            bar.addSeparator();
        else
            bar.add(action).setFocusable(false);
    }
    return bar;
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:12,代码来源:SelectRowDialog.java


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