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


Java JToolBar.setLayout方法代碼示例

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


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

示例1: createToolbar

import javax.swing.JToolBar; //導入方法依賴的package包/類
private JToolBar createToolbar() {
    JToolBar toolBar = new JToolBar();
    toolBar.setFloatable(false);
    toolBar.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    toolBar.setLayout(new javax.swing.BoxLayout(toolBar, javax.swing.BoxLayout.X_AXIS));

    JButton pull = Utils.createButton("Pull", TestExecutionUI.this);
    pull.setToolTipText("Pull Selected TestCases to TestSet");
    pull.setIcon(Utils.getIconByResourceName("/ui/resources/testExecution/pull"));
    JButton export = Utils.createButton("Export", TestExecutionUI.this);
    export.setToolTipText("Export Selected TestCases into Manual TestCases");
    export.setIcon(Utils.getIconByResourceName("/ui/resources/testExecution/export"));
    filterButton = Utils.createButton("Filter", TestExecutionUI.this);
    filterButton.setToolTipText("Filter TestCases By Tags");
    filterButton.setIcon(Utils.getIconByResourceName("/ui/resources/toolbar/tag"));
    toolBar.add(pull);
    toolBar.add(export);
    toolBar.add(filterButton);
    return toolBar;
}
 
開發者ID:CognizantQAHub,項目名稱:Cognizant-Intelligent-Test-Scripter,代碼行數:21,代碼來源:TestExecutionUI.java

示例2: MainToolBar

import javax.swing.JToolBar; //導入方法依賴的package包/類
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,代碼行數:17,代碼來源:HierarchyTopComponent.java

示例3: 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

示例4: createToolBar

import javax.swing.JToolBar; //導入方法依賴的package包/類
private void createToolBar() {
    searchBar = new JToolBar();
    searchBar.setFloatable(false);
    searchBar.setLayout(new BoxLayout(searchBar, BoxLayout.X_AXIS));
    searchBar.setBorder(BorderFactory.createEtchedBorder());

    JLabel searchLabel = new JLabel(Utils.getIconByResourceName("/ui/resources/search"));

    searchField = new JTextField();
    searchField.setActionCommand("SearchField");
    searchField.addActionListener(this);

    searchBar.add(searchLabel);
    searchBar.add(new javax.swing.Box.Filler(new java.awt.Dimension(5, 0),
            new java.awt.Dimension(5, 0),
            new java.awt.Dimension(5, 32767)));
    searchBar.add(searchField);

}
 
開發者ID:CognizantQAHub,項目名稱:Cognizant-Intelligent-Test-Scripter,代碼行數:20,代碼來源:TreeSearch.java

示例5: 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

示例6: 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

示例7: withToolbar

import javax.swing.JToolBar; //導入方法依賴的package包/類
private JToolBar withToolbar(JComponent a, JComponent b) {
    JToolBar tbar = getToolbar();
    tbar.add(a);
    tbar.add(b);
    tbar.setLayout(new BoxLayout(tbar, BoxLayout.LINE_AXIS));
    return tbar;
}
 
開發者ID:CognizantQAHub,項目名稱:Cognizant-Intelligent-Test-Scripter,代碼行數:8,代碼來源:JSList.java


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