javax.swing.JToolBar.setLayout()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(10.0k)|赞(0)|评价(0)|浏览(157)

本文整理了Java中javax.swing.JToolBar.setLayout()方法的一些代码示例,展示了JToolBar.setLayout()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JToolBar.setLayout()方法的具体详情如下:
包路径:javax.swing.JToolBar
类名称:JToolBar
方法名:setLayout

JToolBar.setLayout介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

bar.setLayout(new FlowLayout(FlowLayout.LEFT));
bar.add(combo);
return bar;

代码示例来源:origin: stackoverflow.com

JToolBar bar = new JToolBar("Edit Menu");
bar.setLayout(new FlowLayout(FlowLayout.LEFT));

代码示例来源:origin: robo-code/robocode

private JToolBar getStatusBar() {
  if (statusBar == null) {
    statusBar = new JToolBar();
    statusBar.setLayout(new BorderLayout());
    statusBar.add(getLineLabel(), BorderLayout.WEST);
  }
  return statusBar;
}

代码示例来源:origin: org.geotools/gt-widgets-swing-pending

/** Creates new form JSimpleDialog */
public JSimpleDialog(java.awt.Frame parent, boolean modal,Component child) {
  super(parent, modal);
  initComponents();
  
  JToolBar guiBar = new JToolBar();
  guiBar.setLayout(new FlowLayout(FlowLayout.RIGHT));
  guiBar.add(guiClose);
  guiBar.setFloatable(false);
  
  JScrollPane jsp = new JScrollPane(child);
  
  add(BorderLayout.CENTER,jsp);
  add(BorderLayout.SOUTH,guiBar);
  
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf

public void setOrientation(int orientation)
{
  toolBar.setOrientation(orientation);
  if(toolBar.getOrientation()==JToolBar.HORIZONTAL)
    toolBar.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
  else
    toolBar.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0));
  
  if (dragWindow != null)
    dragWindow.setOrientation(orientation);
}

代码示例来源:origin: khuxtable/seaglass

@Override
protected void installDefaults() {
  toolBar.setLayout(createLayout());
  updateStyle(toolBar);
}

代码示例来源:origin: org.zaproxy/zap

private JToolBar getPanelToolbar() {
  if (panelToolbar == null) {
    panelToolbar = new javax.swing.JToolBar();
    panelToolbar.setLayout(new GridBagLayout());
    panelToolbar.setEnabled(true);
    panelToolbar.setFloatable(false);
    panelToolbar.setRollover(true);
    panelToolbar.setPreferredSize(new java.awt.Dimension(800, 30));
    panelToolbar.setName(panelPrefix + ".toolbar");
    setupToolbarElements(panelToolbar);
  }
  return panelToolbar;
}

代码示例来源:origin: stackoverflow.com

JToolBar toolbar = new JToolBar();
toolbar.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
toolbar.setLayout(new FlowLayout(FlowLayout.RIGHT));
toolbar.add(new JLabel("1"));
toolbar.add(new JTextField(9));

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Creates a new JConfigurationPanel.
 */
public JConfigurationPanel() {
  toolbar = new JToolBar();
  toolbar.setFloatable(false);
  toolbar.setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0));
  toolbar.add(new JToolBar.Separator(new Dimension(8, 8)));
  if (Platform.isOSX || isMetalSteel()) {
    toolbar.setBackground(new Color(0xf8, 0xf8, 0xf8));
  }
  toolbar.setOpaque(true);
  panel = new JPanel();
  layout = Platform.isOSX ? new ResizingCardLayout() : new CardLayout();
  group = new ButtonGroup();
  setLayout(new BorderLayout());
  panel.setLayout(layout);
  add(toolbar, BorderLayout.NORTH);
  add(panel);
}

代码示例来源:origin: apache/batik

/**
 * Creates a new JConfigurationPanel.
 */
public JConfigurationPanel() {
  toolbar = new JToolBar();
  toolbar.setFloatable(false);
  toolbar.setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0));
  toolbar.add(new JToolBar.Separator(new Dimension(8, 8)));
  if (Platform.isOSX || isMetalSteel()) {
    toolbar.setBackground(new Color(0xf8, 0xf8, 0xf8));
  }
  toolbar.setOpaque(true);
  panel = new JPanel();
  layout = Platform.isOSX ? new ResizingCardLayout() : new CardLayout();
  group = new ButtonGroup();
  setLayout(new BorderLayout());
  panel.setLayout(layout);
  add(toolbar, BorderLayout.NORTH);
  add(panel);
}

代码示例来源:origin: org.zaproxy/zap

panelToolbar.setLayout(new java.awt.GridBagLayout());
panelToolbar.setEnabled(true);
panelToolbar.setFloatable(false);

代码示例来源:origin: org.jclarion/clarion-runtime

@Override
public void constructSwingComponent(Container parent) {
  toolbar = new JToolBar();
  toolbar.setLayout(new ClarionLayoutManager());
  parent.add(toolbar);
  for (AbstractControl child : getChildren()) 
  {
    child.constructSwingComponent(toolbar);
  }
  configureFont(toolbar);
  configureColor(toolbar);
  setPositionAndState();
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-terminal-nb

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

代码示例来源:origin: org.zaproxy/zap

private javax.swing.JToolBar getPanelToolbar() {
  if (panelToolbar == null) {
    
    panelToolbar = new javax.swing.JToolBar();
    panelToolbar.setLayout(new GridBagLayout());
    panelToolbar.setEnabled(true);
    panelToolbar.setFloatable(false);
    panelToolbar.setRollover(true);
    panelToolbar.setPreferredSize(new Dimension(800,30));
    panelToolbar.setName("ScriptsListToolbar");
    
    int i = 1;
    panelToolbar.add(getScopeButton(), LayoutHelper.getGBC(i++, 0, 1, 0.0D));
    panelToolbar.add(getCreateContextButton(), LayoutHelper.getGBC(i++, 0, 1, 0.0D));
    panelToolbar.add(getImportContextButton(), LayoutHelper.getGBC(i++, 0, 1, 0.0D));
    panelToolbar.add(getExportContextButton(), LayoutHelper.getGBC(i++, 0, 1, 0.0D));
    
    // TODO Disabled for now due to problems with scrolling with sparcely populated filtered trees
    //panelToolbar.add(getFilterButton(), LayoutHelper.getGBC(i++, 0, 1, 0.0D));
    //panelToolbar.add(getFilterStatus(), LayoutHelper.getGBC(i++, 0, 1, 0.0D));
    panelToolbar.add(new JLabel(), LayoutHelper.getGBC(20, 0, 1, 1.0D));	// spacer
  }
  return panelToolbar;
}

代码示例来源:origin: freeplane/freeplane

/**
 */
public FreeplaneToolBar(final String name, final int orientation) {
  super(name, orientation);
  this.setMargin(FreeplaneToolBar.nullInsets);
  setFloatable(false);
  setRollover(true);
  if(orientation == SwingConstants.HORIZONTAL)
    super.setLayout(ToolbarLayout.horizontal());
  else
    super.setLayout(ToolbarLayout.vertical());
  addHierarchyBoundsListener(new HierarchyBoundsListener() {
    @Override
    public void ancestorResized(final HierarchyEvent e) {
      revalidate();
      repaint();
    }
    @Override
    public void ancestorMoved(final HierarchyEvent e) {
    }
  });
}

代码示例来源:origin: triplea-game/triplea

private JToolBar createButtonsToolBar(final ConsoleModel model) {
 final JToolBar buttonsToolBar = new JToolBar(SwingConstants.HORIZONTAL);
 buttonsToolBar.setFloatable(false);
 buttonsToolBar.setLayout(new FlowLayout());
 buttonsToolBar.add(SwingAction.of("Enumerate Threads", () -> ConsoleModel.enumerateThreadsAction(this)));
 buttonsToolBar.add(SwingAction.of("Memory", () -> ConsoleModel.memoryAction(this)));
 buttonsToolBar.add(SwingAction.of("Properties", () -> ConsoleModel.propertiesAction(this)));
 buttonsToolBar.add(SwingAction.of("Copy to clipboard", () -> model.copyToClipboardAction(this)));
 buttonsToolBar.add(SwingAction.of("Clear", () -> ConsoleModel.clearAction(this)));
 buttonsToolBar.add(
   JComboBoxBuilder.builder(String.class)
     .selectedItem(ConsoleModel.getCurrentLogLevel())
     .items(ConsoleModel.getLogLevelOptions())
     .itemSelectedAction(ConsoleModel::setLogLevel)
     .toolTipText("Increase or decrease log messages printed to console")
     .build());
 return buttonsToolBar;
}

代码示例来源:origin: org.zaproxy/zap

panelToolbar.setLayout(new GridBagLayout());
panelToolbar.setEnabled(true);
panelToolbar.setFloatable(false);

代码示例来源:origin: org.apache.cayenne.modeler/cayenne-modeler

private void initView() {
  graphRegistry = new GraphRegistry();
  needRebuild = true;
  mediator.addDomainDisplayListener(this);
  setLayout(new BorderLayout());
  JToolBar toolbar = new JToolBar();
  toolbar.setFloatable(false);
  toolbar.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
  GraphType[] types = GraphType.values();
  String[] names = new String[types.length];
  for (int i = 0; i < types.length; i++) {
    names[i] = types[i].getName();
  }
  diagramCombo = Application.getWidgetFactory().createComboBox(names, false);
  diagramCombo.addItemListener(this);
  toolbar.add(new RebuildGraphAction(this, Application.getInstance()).buildButton(1));
  toolbar.add(new SaveAsImageAction(this, Application.getInstance()).buildButton(3));
  toolbar.addSeparator();
  toolbar.add(new ZoomInAction(this, Application.getInstance()).buildButton(1));
  toolbar.add(new ZoomOutAction(this, Application.getInstance()).buildButton(3));
  toolbar.addSeparator();
  toolbar.add(new JLabel("Diagram: "));
  toolbar.add(diagramCombo);
  add(toolbar, BorderLayout.NORTH);
  scrollPane = new JScrollPane();
  add(scrollPane);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mercurial

/**
 * Creates a new Synchronize Panel managed by the given versioning system.
 *
 * @param parent enclosing top component
 */
public VersioningPanel(HgVersioningTopComponent parent) {
  this.parentTopComponent = parent;
  this.mercurial = Mercurial.getInstance();
  refreshViewTask = rp.create(new RefreshViewTask());
  explorerManager = new ExplorerManager();
  displayStatuses = FileInformation.STATUS_LOCAL_CHANGE;
  noContentComponent.setLabel(NbBundle.getMessage(VersioningPanel.class, "MSG_No_Changes_All")); // NOI18N
  syncTable = new SyncTable();
  
  initComponents();
  setVersioningComponent(syncTable.getComponent());
  reScheduleRefresh(0);
  
  // XXX click it in form editor, probbaly requires  Mattisse >=v2
  jPanel2.setFloatable(false);
  jPanel2.putClientProperty("JToolBar.isRollover", Boolean.TRUE);  // NOI18N
  jPanel2.setLayout(new ToolbarLayout());
  
  if( "Aqua".equals( UIManager.getLookAndFeel().getID() ) ) {             // NOI18N
    Color color = UIManager.getColor("NbExplorerView.background");      // NOI18N
    setBackground(color); 
    jPanel2.setBackground(color); 
  }        
}

代码示例来源:origin: khuxtable/seaglass

@Override
protected void uninstallDefaults() {
  SeaGlassContext context = getContext(toolBar, ENABLED);
  style.uninstallDefaults(context);
  context.dispose();
  style = null;
  handleIcon = null;
  context = getContext(toolBar, Region.TOOL_BAR_CONTENT, contentStyle, ENABLED);
  contentStyle.uninstallDefaults(context);
  context.dispose();
  contentStyle = null;
  context = getContext(toolBar, Region.TOOL_BAR_DRAG_WINDOW, dragWindowStyle, ENABLED);
  dragWindowStyle.uninstallDefaults(context);
  context.dispose();
  dragWindowStyle = null;
  toolBar.setLayout(null);
}

相关文章

JToolBar类方法