java.awt.FlowLayout.setAlignment()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(435)

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

FlowLayout.setAlignment介绍

[英]Sets the alignment for this layout. Possible values are

  • FlowLayout.LEFT
  • FlowLayout.RIGHT
  • FlowLayout.CENTER
    [中]设置此布局的对齐方式。可能的值是
  • FlowLayout.LEFT
  • FlowLayout.RIGHT
  • FlowLayout.CENTER

代码示例

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

/**
 * Creates new form MainWindow
 */
public MainWindow() {
  initComponents();
  uriField.setText(Main.Config.DEFAULT_BASE_URI);
  ((FlowLayout) messagePanel.getLayout()).setAlignment(FlowLayout.LEADING);
  messagePanel.removeAll();
  messagePanel.revalidate();
}

代码示例来源:origin: stanfordnlp/CoreNLP

buttonPanel.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
FlowLayout fl = new FlowLayout();
fl.setAlignment(FlowLayout.RIGHT);
buttonPanel.setLayout(fl);
tagButton.setText("Tag sentence!");

代码示例来源:origin: cmusphinx/sphinx4

JPanel buttonPanel = new JPanel();
FlowLayout layout = new FlowLayout();
layout.setAlignment(FlowLayout.LEFT);
buttonPanel.setLayout(layout);

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

FlowLayout layout = new FlowLayout();
 layout.setAlignment(FlowLayout.CENTER);
 c.setLayout(layout);
 c.add(panel);

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

JPanel jpSouth = new JPanel();
FlowLayout flowLayout_1 = (FlowLayout) jpSouth.getLayout();
flowLayout_1.setAlignment(FlowLayout.TRAILING);

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

JPanel panel = new JPanel(); // your toolbar panel
 FlowLayout flowLayout = (FlowLayout) panel.getLayout(); // flowlayout
 flowLayout.setAlignment(FlowLayout.LEFT); // alignment to left
 contentPane.add(panel, BorderLayout.NORTH); // adding this panel to original frame

代码示例来源:origin: antlr/antlr3

private void initComponents() {
  labelText.setPreferredSize(new Dimension(300, 20));
  labelText.setHorizontalTextPosition(JLabel.LEFT);
  progress.setPreferredSize(new Dimension(100, 15));
  final JLabel labRuleHint = new JLabel("Rule: ");
  FlowLayout layout = new FlowLayout();
  layout.setAlignment(FlowLayout.LEFT);
  panel.setLayout(layout);
  panel.add(labelText);
  panel.add(progress);
  panel.add(labRuleHint);
  panel.add(labelRuleName);
  panel.setOpaque(false);
  panel.setBorder(javax.swing.BorderFactory.createEmptyBorder());
}

代码示例来源:origin: org.antlr/gunit

private void initComponents() {
  labelText.setPreferredSize(new Dimension(300, 20));
  labelText.setHorizontalTextPosition(JLabel.LEFT);
  progress.setPreferredSize(new Dimension(100, 15));
  final JLabel labRuleHint = new JLabel("Rule: ");
  FlowLayout layout = new FlowLayout();
  layout.setAlignment(FlowLayout.LEFT);
  panel.setLayout(layout);
  panel.add(labelText);
  panel.add(progress);
  panel.add(labRuleHint);
  panel.add(labelRuleName);
  panel.setOpaque(false);
  panel.setBorder(javax.swing.BorderFactory.createEmptyBorder());
}

代码示例来源:origin: antlr/antlr3

private void initComponents() {
  labelText.setPreferredSize(new Dimension(300, 20));
  labelText.setHorizontalTextPosition(JLabel.LEFT);
  progress.setPreferredSize(new Dimension(100, 15));
  final JLabel labRuleHint = new JLabel("Rule: ");
  FlowLayout layout = new FlowLayout();
  layout.setAlignment(FlowLayout.LEFT);
  panel.setLayout(layout);
  panel.add(labelText);
  panel.add(progress);
  panel.add(labRuleHint);
  panel.add(labelRuleName);
  panel.setOpaque(false);
  panel.setBorder(javax.swing.BorderFactory.createEmptyBorder());
}

代码示例来源:origin: robotframework/SwingLibrary

private void createMainPanel() {
  panel = new PopupPanel();
  panel.setName("Main Panel");
  FlowLayout flowLayout = new FlowLayout();
  flowLayout.setAlignment(FlowLayout.CENTER);
  panel.setLayout(flowLayout);
}

代码示例来源:origin: org.fuin/utils4swing

private JPanel getPanelTitle() {
  if (panelTitle == null) {
    final FlowLayout flowLayout = new FlowLayout();
    flowLayout.setHgap(10);
    flowLayout.setAlignment(FlowLayout.LEFT);
    flowLayout.setVgap(10);
    panelTitle = new JPanel();
    panelTitle.setLayout(flowLayout);
    panelTitle.setPreferredSize(new Dimension(40, 30));
    panelTitle.add(getLabelTitle(), null);
  }
  return panelTitle;
}

代码示例来源:origin: com.eas.platypus/platypus-js-calendar-widget

/**
     * Creates the Dialog and returns the Result
     * @param MessageOption that was pressed
     */
  private int showConfirmDialog() {
    JTextField tf = new JTextField();

    JPanel calPanel = new JPanel();
    FlowLayout layout = new FlowLayout();
    layout.setAlignment(FlowLayout.LEFT);
    layout.setHgap(0);
    layout.setVgap(0);
    calPanel.setLayout(layout);
    calPanel.add(_calendarBox);

    Object[] msg = { _message, calPanel };
    int result = JOptionPane.showConfirmDialog(_parentComponent, msg, _title, _optionType, _messageType);
    return result;
  }
}

代码示例来源:origin: org.fuin/utils4swing

private JPanel getPanelButtons() {
  if (panelButtons == null) {
    final FlowLayout flowLayout2 = new FlowLayout();
    flowLayout2.setAlignment(FlowLayout.RIGHT);
    flowLayout2.setVgap(10);
    flowLayout2.setHgap(10);
    panelButtons = new JPanel();
    panelButtons.setLayout(flowLayout2);
    panelButtons.setPreferredSize(new Dimension(200, 45));
    panelButtons.add(getCheckBoxIncludeSubdirs(), null);
    panelButtons.add(getButtonCancel(), null);
    panelButtons.add(getButtonOK(), null);
  }
  return panelButtons;
}

代码示例来源:origin: org.jacorb/jacorb

/**
 * Return the CloseButtonPanelFlowLayout property value.
 * @return java.awt.FlowLayout
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private java.awt.FlowLayout getCloseButtonPanelFlowLayout() {
  java.awt.FlowLayout ivjCloseButtonPanelFlowLayout = null;
  try {
    /* Create part */
    ivjCloseButtonPanelFlowLayout = new java.awt.FlowLayout();
    ivjCloseButtonPanelFlowLayout.setAlignment(java.awt.FlowLayout.RIGHT);
    ivjCloseButtonPanelFlowLayout.setHgap(10);
  } catch (java.lang.Throwable ivjExc) {
    handleException(ivjExc);
  };
  return ivjCloseButtonPanelFlowLayout;
}
/**

代码示例来源:origin: nroduit/Weasis

public void initGUI() {
  setLayout(new BorderLayout());
  panel = new JPanel();
  FlowLayout flowLayout = (FlowLayout) panel.getLayout();
  flowLayout.setAlignment(FlowLayout.LEFT);
  lblImportAFolder = new JLabel(Messages.getString("LocalExport.exp") + StringUtil.COLON); //$NON-NLS-1$
  panel.add(lblImportAFolder);
  comboBoxImgFormat = new JComboBox<>(new DefaultComboBoxModel<>(EXPORT_FORMAT));
  panel.add(comboBoxImgFormat);
  add(panel, BorderLayout.NORTH);
  btnNewButton = new JButton(Messages.getString("LocalExport.options")); //$NON-NLS-1$
  btnNewButton.addActionListener(e -> showExportingOptions());
  panel.add(btnNewButton);
  add(exportTree, BorderLayout.CENTER);
}

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

public FlowView() {
    FlowLayout flow = new FlowLayout(FlowLayout.LEFT, 5, 5);
    this.setOpaque(false);
    this.setBorder(null);
    flow.setAlignment(FlowLayout.LEFT);
    this.setLayout(flow);
  }
}

代码示例来源:origin: Audiveris/audiveris

public ShapeHistory ()
{
  panel.setNoInsets();
  panel.setPreferredSize(new Dimension(BOARD_WIDTH, 80));
  panel.setVisible(false);
  FlowLayout layout = new FlowLayout();
  layout.setAlignment(FlowLayout.LEADING);
  panel.setLayout(layout);
}

代码示例来源:origin: nroduit/Weasis

public void initGUI() {
  setLayout(new BorderLayout());
  FlowLayout flowLayout = (FlowLayout) panel.getLayout();
  flowLayout.setAlignment(FlowLayout.LEFT);
  final JLabel lblDest = new JLabel(Messages.getString("SendDicomView.destination") + StringUtil.COLON); //$NON-NLS-1$
  panel.add(lblDest);
  AbstractDicomNode.addTooltipToComboList(comboNode);
  panel.add(comboNode);
  add(panel, BorderLayout.NORTH);
  add(exportTree, BorderLayout.CENTER);
}

代码示例来源:origin: JGillam/burp-co2

public MiscTab(IBurpExtenderCallbacks callbacks) {
  FlowLayout flow = new FlowLayout();
  flow.setAlignment(FlowLayout.LEFT);
  this.setLayout(flow);
  Box mainBox = Box.createVerticalBox();
  payloadProcessor = new IntruderPayloadProcessor();
  callbacks.registerIntruderPayloadProcessor(payloadProcessor);
  beautifierFactory = new MessageBeautifierFactory(callbacks);
  mainBox.add(beautifierFactory.getUiComponent());
  mainBox.add(payloadProcessor.getUiComponent());
  this.add(mainBox);
}

代码示例来源:origin: nroduit/Weasis

public WtoolBar(String barName, int position) {
  FlowLayout flowLayout = (FlowLayout) getLayout();
  flowLayout.setVgap(0);
  flowLayout.setHgap(0);
  flowLayout.setAlignment(FlowLayout.LEADING);
  this.barName = barName;
  this.barPosition = position;
  this.setAlignmentX(LEFT_ALIGNMENT);
  this.setAlignmentY(TOP_ALIGNMENT);
  setOpaque(false);
  addSeparator(SEPARATOR_2x24);
}

相关文章