javax.swing.GroupLayout.createParallelGroup()方法的使用及代码示例

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

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

GroupLayout.createParallelGroup介绍

暂无

代码示例

代码示例来源:origin: kiegroup/optaplanner

public MachineReassignmentPanel() {
  GroupLayout layout = new GroupLayout(this);
  setLayout(layout);
  createMachineListPanel();
  JPanel headerPanel = new JPanel();
  layout.setHorizontalGroup(layout.createParallelGroup()
      .addComponent(headerPanel).addComponent(machineListPanel));
  layout.setVerticalGroup(layout.createSequentialGroup()
      .addComponent(headerPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
          GroupLayout.PREFERRED_SIZE)
      .addComponent(machineListPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
          GroupLayout.PREFERRED_SIZE));
}

代码示例来源:origin: kiegroup/optaplanner

public NurseRosteringPanel() {
  employeeIcon = new ImageIcon(getClass().getResource("employee.png"));
  deleteEmployeeIcon = new ImageIcon(getClass().getResource("deleteEmployee.png"));
  GroupLayout layout = new GroupLayout(this);
  setLayout(layout);
  createEmployeeListPanel();
  JPanel headerPanel = createHeaderPanel();
  layout.setHorizontalGroup(layout.createParallelGroup()
      .addComponent(headerPanel).addComponent(employeeListPanel));
  layout.setVerticalGroup(layout.createSequentialGroup()
      .addComponent(headerPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
          GroupLayout.PREFERRED_SIZE)
      .addComponent(employeeListPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
          GroupLayout.PREFERRED_SIZE));
}

代码示例来源:origin: kiegroup/optaplanner

public CloudBalancingPanel() {
  cloudComputerIcon = new ImageIcon(getClass().getResource("cloudComputer.png"));
  addCloudComputerIcon = new ImageIcon(getClass().getResource("addCloudComputer.png"));
  deleteCloudComputerIcon = new ImageIcon(getClass().getResource("deleteCloudComputer.png"));
  cloudProcessIcon = new ImageIcon(getClass().getResource("cloudProcess.png"));
  addCloudProcessIcon = new ImageIcon(getClass().getResource("addCloudProcess.png"));
  deleteCloudProcessIcon = new ImageIcon(getClass().getResource("deleteCloudProcess.png"));
  GroupLayout layout = new GroupLayout(this);
  setLayout(layout);
  JPanel headerPanel = createHeaderPanel();
  JPanel computersPanel = createComputersPanel();
  layout.setHorizontalGroup(layout.createParallelGroup()
      .addComponent(headerPanel).addComponent(computersPanel));
  layout.setVerticalGroup(layout.createSequentialGroup()
      .addComponent(headerPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
          GroupLayout.PREFERRED_SIZE)
      .addComponent(computersPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
          GroupLayout.PREFERRED_SIZE));
}

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

BookPanel(Book b)
{
  setBorder(new EmptyBorder(3, 3, 3, 3));
  setBackground(ColorScheme.DARK_GRAY_COLOR);
  GroupLayout layout = new GroupLayout(this);
  this.setLayout(layout);
  JLabel image = new JLabel();
  b.getIcon().addTo(image);
  JLabel name = new JLabel(b.getShortName());
  location.setFont(FontManager.getRunescapeSmallFont());
  layout.setVerticalGroup(layout.createParallelGroup()
    .addComponent(image)
    .addGroup(layout.createSequentialGroup()
      .addComponent(name)
      .addComponent(location)
    )
  );
  layout.setHorizontalGroup(layout.createSequentialGroup()
    .addComponent(image)
    .addGap(8)
    .addGroup(layout.createParallelGroup()
      .addComponent(name)
      .addComponent(location)
    )
  );
  // AWT's Z order is weird. This put image at the back of the stack
  setComponentZOrder(image, getComponentCount() - 1);
}

代码示例来源:origin: deathmarine/Luyten

layout.setHorizontalGroup(
    layout.createSequentialGroup().addComponent(label)
        .addGroup(
            layout.createParallelGroup(Alignment.LEADING).addComponent(statusLabel)
                .addComponent(textField)
                .addGroup(layout.createSequentialGroup()
                    .addGroup(layout.createParallelGroup(Alignment.LEADING)
                        .addComponent(mcase))
                .addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(wholew))
                .addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(regex))
                .addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(classname)))
    .addGroup(layout.createSequentialGroup()
        .addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(listScroller)
            .addComponent(progressBar))))
    .addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(findButton))
layout.setVerticalGroup(layout.createSequentialGroup()
    .addGroup(layout.createParallelGroup(Alignment.BASELINE).addComponent(label).addComponent(textField)
        .addComponent(findButton))
    .addGroup(layout.createParallelGroup(Alignment.BASELINE).addComponent(mcase).addComponent(wholew)
        .addComponent(regex).addComponent(classname))
    .addGroup(layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addGroup(layout.createParallelGroup(Alignment.BASELINE).addComponent(listScroller))))
    .addGroup(layout.createParallelGroup(Alignment.LEADING)).addComponent(statusLabel)
    .addComponent(progressBar));
this.adjustWindowPositionBySavedState();
this.setSaveWindowPositionOnClosing();

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

GroupLayout layout = new GroupLayout(this);          
this.setLayout(layout);
layout.setAutoCreateGaps(true);
layout.setAutoCreateContainerGaps(true);
layout.setHorizontalGroup(layout.createSequentialGroup()
  .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
    .addComponent(label1)
    .addComponent(label2)
    .addComponent(label3))
  .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
    .addComponent(field1)
    .addComponent(field2)
    .addComponent(field3))
);
layout.setVerticalGroup(layout.createSequentialGroup()
  .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
    .addComponent(label1)
    .addComponent(field1))
  .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
    .addComponent(label2)
    .addComponent(field2))
  .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
    .addComponent(label3)
    .addComponent(field3))

代码示例来源:origin: deathmarine/Luyten

this.setResizable(false);
GroupLayout layout = new GroupLayout(getRootPane());
getRootPane().setLayout(layout);
layout.setAutoCreateGaps(true);
layout.setAutoCreateContainerGaps(true);
layout.setHorizontalGroup(layout.createSequentialGroup().addComponent(label)
    .addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(textField)
        .addGroup(layout.createSequentialGroup()
            .addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(mcase)
                .addComponent(wholew).addComponent(wrap))
        .addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(regex)
            .addComponent(reverse))))
    .addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(findButton)));
layout.setVerticalGroup(layout.createSequentialGroup()
    .addGroup(layout.createParallelGroup(Alignment.BASELINE).addComponent(label).addComponent(textField)
        .addComponent(findButton))
    .addGroup(layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addGroup(layout.createParallelGroup(Alignment.BASELINE).addComponent(mcase)
                .addComponent(regex))
            .addGroup(layout.createParallelGroup(Alignment.BASELINE).addComponent(wholew)
                .addComponent(reverse))
            .addGroup(layout.createParallelGroup(Alignment.BASELINE).addComponent(wrap)))));

代码示例来源:origin: kiegroup/optaplanner

private JComponent createToolBar() {
  GroupLayout toolBarLayout = new GroupLayout(toolBar);
  toolBar.setLayout(toolBarLayout);
  solveButton.setPreferredSize(terminateSolvingEarlyButton.getPreferredSize());
  GroupLayout.SequentialGroup horizontalGroup = toolBarLayout.createSequentialGroup();
  if (solutionBusiness.hasImporter()) {
    horizontalGroup.addComponent(importButton);
  horizontalGroup.addComponent(openButton);
  horizontalGroup.addComponent(saveButton);
  if (solutionBusiness.hasExporter()) {
    horizontalGroup.addComponent(exportButton);
  horizontalGroup.addComponent(solvePanel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE);
  horizontalGroup.addComponent(progressBar, 20, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE);
  toolBarLayout.setHorizontalGroup(horizontalGroup);
  GroupLayout.ParallelGroup verticalGroup = toolBarLayout.createParallelGroup(GroupLayout.Alignment.CENTER);
  if (solutionBusiness.hasImporter()) {
    verticalGroup.addComponent(importButton);
  toolBarLayout.setVerticalGroup(verticalGroup);
  return toolBar;

代码示例来源:origin: magefree/mage

private void initComponents(Component container) {
  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
  this.setLayout(layout);
  layout.setHorizontalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addComponent(container, javax.swing.GroupLayout.DEFAULT_SIZE, 885, Short.MAX_VALUE)
  );
  layout.setVerticalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addComponent(container, javax.swing.GroupLayout.DEFAULT_SIZE, 626, Short.MAX_VALUE)
  );
}

代码示例来源:origin: magefree/mage

private void initComponents(Component container) {
  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
  this.setLayout(layout);
  layout.setHorizontalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(container, javax.swing.GroupLayout.DEFAULT_SIZE, 885, Short.MAX_VALUE)
  );
  layout.setVerticalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(container, javax.swing.GroupLayout.DEFAULT_SIZE, 626, Short.MAX_VALUE)
  );
}

代码示例来源:origin: magefree/mage

private void initComponents(JComponent container) {
  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
  this.setLayout(layout);
  layout.setHorizontalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addComponent(container, javax.swing.GroupLayout.DEFAULT_SIZE, 541, Short.MAX_VALUE)
  );
  layout.setVerticalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addComponent(container, javax.swing.GroupLayout.DEFAULT_SIZE, 471, Short.MAX_VALUE)
  );
}

代码示例来源:origin: magefree/mage

private void initComponents(Component container) {
  Component component = container != null ? container : new CollectionViewerPanel();
  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
  this.setLayout(layout);
  layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(component, javax.swing.GroupLayout.DEFAULT_SIZE, 885, Short.MAX_VALUE)
  );
  layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(component, javax.swing.GroupLayout.DEFAULT_SIZE, 626, Short.MAX_VALUE)
  );
}

代码示例来源:origin: magefree/mage

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
  deckEditorPanel1 = new mage.client.deckeditor.DeckEditorPanel();
  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
  this.setLayout(layout);
  layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(deckEditorPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 885, Short.MAX_VALUE)
  );
  layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(deckEditorPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 626, Short.MAX_VALUE)
  );
}// </editor-fold>//GEN-END:initComponents

代码示例来源:origin: magefree/mage

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
  tournamentPanel = new mage.client.tournament.TournamentPanel();
  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
  this.setLayout(layout);
  layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(tournamentPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 758, Short.MAX_VALUE)
  );
  layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(tournamentPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 526, Short.MAX_VALUE)
  );
}// </editor-fold>//GEN-END:initComponents

代码示例来源:origin: magefree/mage

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
  tablesPanel = new mage.client.table.TablesPanel();
  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
  this.setLayout(layout);
  layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(tablesPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 541, Short.MAX_VALUE)
  );
  layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(tablesPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 471, Short.MAX_VALUE)
  );
}// </editor-fold>//GEN-END:initComponents

代码示例来源:origin: magefree/mage

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
  jScrollPane1 = new javax.swing.JScrollPane();
  draftPanel1 = new mage.client.draft.DraftPanel();
  jScrollPane1.setViewportView(draftPanel1);
  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
  this.setLayout(layout);
  layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 868, Short.MAX_VALUE)
  );
  layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 582, Short.MAX_VALUE)
  );
}// </editor-fold>//GEN-END:initComponents

代码示例来源:origin: magefree/mage

lblPlayerNum.setText("Player #");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(lblPlayerNum)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(lbPlayerType)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(cbPlayerType, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(newPlayerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 318, Short.MAX_VALUE))
);
layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(lblPlayerNum)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(cbPlayerType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(lbPlayerType)))

代码示例来源:origin: magefree/mage

btnYes.addActionListener(evt -> btnYesActionPerformed(evt));
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
    .addContainerGap()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
      .addComponent(lblQuestion, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 207, Short.MAX_VALUE)
      .addGroup(layout.createSequentialGroup()
        .addComponent(btnYes)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(btnNo)))
    .addContainerGap())
);
layout.setVerticalGroup(
  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
    .addContainerGap()
    .addComponent(lblQuestion, javax.swing.GroupLayout.DEFAULT_SIZE, 35, Short.MAX_VALUE)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
      .addComponent(btnNo)
      .addComponent(btnYes))

代码示例来源:origin: magefree/mage

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
  this.setLayout(layout);
  layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGap(0, 294, Short.MAX_VALUE)
  );
  layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGap(0, 197, Short.MAX_VALUE)
  );
}// </editor-fold>//GEN-END:initComponents

代码示例来源:origin: magefree/mage

/** This method is called from within the constructor to
 * initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
  this.setLayout(layout);
  layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGap(0, 400, Short.MAX_VALUE)
  );
  layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGap(0, 300, Short.MAX_VALUE)
  );
}// </editor-fold>//GEN-END:initComponents

相关文章