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

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

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

GroupLayout.setAutoCreateContainerGaps介绍

暂无

代码示例

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

this.setLayout(layout);
layout.setAutoCreateGaps(true);
layout.setAutoCreateContainerGaps(true);
layout.setHorizontalGroup(layout.createSequentialGroup()
  .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)

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

getRootPane().setLayout(layout);
layout.setAutoCreateGaps(true);
layout.setAutoCreateContainerGaps(true);

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

getRootPane().setLayout(layout);
layout.setAutoCreateGaps(true);
layout.setAutoCreateContainerGaps(true);

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

panel = new JPanel();
Container pane = mainWindow.getContentPane();
GroupLayout gl = new GroupLayout(pane);
pane.setLayout(gl);
gl.setAutoCreateContainerGaps(false);
gl.setHorizontalGroup(gl.createSequentialGroup().addComponent(panel));
gl.setVerticalGroup(gl.createSequentialGroup().addComponent(panel));
// ++++++++++++  editing start
// force do layout subcomponents and rendering
mainWindow.pack();
// ++++++++++++  editing end
System.out.println("w:" + panel.getWidth() + " h:" + panel.getHeight());

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

JPanel complete=new JPanel();
 GroupLayout gl=new GroupLayout(complete);
 complete.setLayout(gl);
 gl.setAutoCreateContainerGaps(true);
 gl.setHorizontalGroup(gl.createParallelGroup() //this is parallel bcz you need components vertically
     .addComponent(visualize)       //you MUST add components to both horizontal and vertical groups
     .addComponent(operations)
     .addComponent(sheet)
 );
 gl.setVerticalGroup(gl.createSequentialGroup() //NOTE that this is sequential
     .addComponent(visualize)
     .addComponent(operations)
     .addGap(50)        //you can add gaps if you want
     .addComponent(sheet)
 );
 add(complete);

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

private void createLayout(JComponent... arg) {

  JPanel pane = new JPanel();
  //Container pane = getContentPane();
  GroupLayout gl = new GroupLayout(pane);
  pane.setLayout(gl);

  gl.setAutoCreateContainerGaps(true);

  gl.setHorizontalGroup(gl.createSequentialGroup()
          .addComponent(arg[0])
  );

  gl.setVerticalGroup(gl.createSequentialGroup()
          .addComponent(arg[0])
  );

  add(pane);

  pack();
}

代码示例来源:origin: GoldenGnu/jeveassets

public BorderPanel(String title, Alignment alignment) {
  this.alignment = alignment;
  jPanel = new JPanel();
  layout = new GroupLayout(jPanel);
  jPanel.setLayout(layout);
  layout.setAutoCreateGaps(true);
  layout.setAutoCreateContainerGaps(false);
  jPanel.setBorder(BorderFactory.createTitledBorder(title));
}

代码示例来源:origin: GoldenGnu/jeveassets

public JGroupLayoutPanel(final Program program) {
  this.program = program;
  jPanel = new JPanel();
  layout = new GroupLayout(jPanel);
  jPanel.setLayout(layout);
  layout.setAutoCreateGaps(true);
  layout.setAutoCreateContainerGaps(true);
}

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

GroupLayout layout = new GroupLayout(panel);
layout.setAutoCreateGaps(true);
layout.setAutoCreateContainerGaps(true);

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

GroupLayout layout = new GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setAutoCreateGaps(true);
    layout.setAutoCreateContainerGaps(true);
    // Turn on automatically creating gaps between components that touch
    // the edge of the container and the container.
    layout.setAutoCreateContainerGaps(true);
    GroupLayout.SequentialGroup hGroup = layout.createSequentialGroup();
    hGroup.addGroup(layout.createParallelGroup(Alignment.LEADING).
        addComponent(ClientIP).addComponent(ClientPassword).addComponent(Videoname).addComponent(perccomplete).addComponent(PacketsSent).addComponent(Connectiontype).addComponent(noofvideossent));
    hGroup.addGroup(layout.createParallelGroup(Alignment.LEADING).
        addComponent(ip).addComponent(pass).addComponent(vname).addComponent(percent).
        addComponent(pacsent).addComponent(conntype).addComponent(videosend).addComponent(disconnect).addComponent(refresh).addComponent(ok));
    layout.setHorizontalGroup(hGroup);
    GroupLayout.SequentialGroup vGroup = layout.createSequentialGroup();
    vGroup.addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(ClientIP).addComponent(ip)).addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(ClientPassword).addComponent(pass)).addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(Videoname).addComponent(vname)).addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(perccomplete).addComponent(percent)).addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(PacketsSent).addComponent(pacsent)).addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(Connectiontype).addComponent(conntype)).addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(noofvideossent).addComponent(videosend));
    vGroup.addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(disconnect)).addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(refresh)).addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(ok));
    layout.setVerticalGroup(vGroup);

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

GroupLayout layout = new GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setAutoCreateGaps(true);
    layout.setAutoCreateContainerGaps(true);
    // Turn on automatically creating gaps between components that touch
    // the edge of the container and the container.
    layout.setAutoCreateContainerGaps(true);
    GroupLayout.SequentialGroup hGroup = layout.createSequentialGroup();
    hGroup.addGroup(layout.createParallelGroup(Alignment.LEADING).
        addComponent(ClientIP).addComponent(ClientPassword).addComponent(Videoname).addComponent(perccomplete).addComponent(PacketsSent).addComponent(Connectiontype).addComponent(noofvideossent));
    hGroup.addGroup(layout.createParallelGroup(Alignment.LEADING).
        addComponent(ip).addComponent(pass).addComponent(vname).addComponent(percent).
        addComponent(pacsent).addComponent(conntype).addComponent(videosend).addComponent(disconnect).addComponent(refresh).addComponent(ok));
    layout.setHorizontalGroup(hGroup);
    GroupLayout.SequentialGroup vGroup = layout.createSequentialGroup();
    vGroup.addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(ClientIP).addComponent(ip)).addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(ClientPassword).addComponent(pass)).addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(Videoname).addComponent(vname)).addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(perccomplete).addComponent(percent)).addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(PacketsSent).addComponent(pacsent)).addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(Connectiontype).addComponent(conntype)).addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(noofvideossent).addComponent(videosend));
    vGroup.addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(disconnect)).addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(refresh)).addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(ok));
    layout.setVerticalGroup(vGroup);

代码示例来源:origin: GoldenGnu/jeveassets

public JMainTab(final Program program, final String title, final Icon icon, final boolean closeable) {
  this.program = program;
  this.title = title;
  this.icon = icon;
  this.closeable = closeable;
  program.addMainTab(this);
  jPanel = new JPanel();
  layout = new GroupLayout(jPanel);
  jPanel.setLayout(layout);
  layout.setAutoCreateGaps(true);
  layout.setAutoCreateContainerGaps(true);
}

代码示例来源:origin: GoldenGnu/jeveassets

public JSettingsPanel(final Program program, final SettingsDialog optionsDialog, final String title, final Icon icon) {
  this.program = program;
  this.title = title;
  this.parent = optionsDialog.getDialog();
  this.icon = icon;
  jPanel = new JPanel();
  layout = new GroupLayout(jPanel);
  jPanel.setLayout(layout);
  layout.setAutoCreateGaps(true);
  layout.setAutoCreateContainerGaps(true);
}

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

@Override
protected JPanel getFieldsPanel() {
  JPanel fieldsPanel = new JPanel();
  GroupLayout layout = new GroupLayout(fieldsPanel);
  fieldsPanel.setLayout(layout);
  layout.setAutoCreateGaps(true);
  layout.setAutoCreateContainerGaps(true);
  JLabel regexLabel = new JLabel(REGEX_FIELD_LABEL);
  layout.setHorizontalGroup(
      layout.createSequentialGroup().addComponent(regexLabel).addComponent(getRegexTextField()));
  layout.setVerticalGroup(
      layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
          .addComponent(regexLabel)
          .addComponent(getRegexTextField()));
  return fieldsPanel;
}

代码示例来源:origin: GoldenGnu/jeveassets

public JCardPanel() {
  cardLayout = new GroupLayout(this);
  setLayout(cardLayout);
  cardLayout.setAutoCreateGaps(true);
  cardLayout.setAutoCreateContainerGaps(false);
}

代码示例来源:origin: GoldenGnu/jeveassets

private JOptionPanel() {
  layout = new GroupLayout(this);
  this.setLayout(layout);
  layout.setAutoCreateGaps(false);
  layout.setAutoCreateContainerGaps(true);
}

代码示例来源:origin: thorikawa/GlassRemote

public InfoPanel() {
  setPreferredSize(new Dimension(WIDTH, HEIGHT));
  GroupLayout layout = new GroupLayout(this);
  layout.setAutoCreateContainerGaps(true);
  layout.setAutoCreateGaps(true);
  setLayout(layout);
  textArea = new JTextArea();
  textArea.setBounds(5, 5, 630, 30);
  textArea.setEditable(false);
  textArea.setFocusable(false);
  layout.setHorizontalGroup(layout.createParallelGroup().addComponent(textArea));
  layout.setVerticalGroup(layout.createSequentialGroup().addComponent(textArea));
}

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

public PassiveScannerOptionsPanel(I18N messages) {
  setName(messages.getString("pscan.options.main.name"));
  GroupLayout layout = new GroupLayout(this);
  setLayout(layout);
  layout.setAutoCreateGaps(true);
  layout.setAutoCreateContainerGaps(true);
  scanOnlyInScopeCheckBox = new JCheckBox();
  JLabel scanOnlyInScopeLabel = new JLabel(messages.getString("pscan.options.main.label.scanOnlyInScope"));
  scanOnlyInScopeLabel.setLabelFor(scanOnlyInScopeCheckBox);
  layout.setHorizontalGroup(
      layout.createSequentialGroup().addComponent(scanOnlyInScopeLabel).addComponent(scanOnlyInScopeCheckBox));
  layout.setVerticalGroup(
      layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
          .addComponent(scanOnlyInScopeLabel)
          .addComponent(scanOnlyInScopeCheckBox));
}

代码示例来源:origin: GoldenGnu/jeveassets

private void updatePanels() {
  jFiltersPanel.removeAll();
  GroupLayout groupLayout = new GroupLayout(jFiltersPanel);
  jFiltersPanel.setLayout(groupLayout);
  groupLayout.setAutoCreateGaps(true);
  groupLayout.setAutoCreateContainerGaps(false);
  ParallelGroup horizontalGroup = groupLayout.createParallelGroup();
  SequentialGroup verticalGroup = groupLayout.createSequentialGroup();
  for (LocationPanel locationPanel : locationPanels) {
    horizontalGroup.addComponent(locationPanel.getPanel());
    verticalGroup.addComponent(locationPanel.getPanel());
  }
  jFiltersPanel.setVisible(!locationPanels.isEmpty());
  groupLayout.setHorizontalGroup(horizontalGroup);
  groupLayout.setVerticalGroup(verticalGroup);
  autoValidate();
  this.getDialog().pack();
}

代码示例来源:origin: org.xworker/xworker_core

public static void init(GroupLayout comp, Thing thing, Container parent, ActionContext actionContext){
    Boolean autoCreateContainerPadding = JavaCreator.createBoolean(thing, "autoCreateContainerPadding");
    if(autoCreateContainerPadding != null){
      comp.setAutoCreateContainerGaps(autoCreateContainerPadding);
    }
    
    Boolean autoCreatePadding = JavaCreator.createBoolean(thing, "autoCreatePadding");
    if(autoCreatePadding != null){
      comp.setAutoCreateGaps(autoCreatePadding);
    }
    
    Boolean honorsVisibility = JavaCreator.createBoolean(thing, "honorsVisibility");
    if(honorsVisibility != null){
      comp.setHonorsVisibility(honorsVisibility);
    }
  }
}

相关文章