javax.swing.JCheckBox.setLocation()方法的使用及代码示例

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

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

JCheckBox.setLocation介绍

暂无

代码示例

代码示例来源:origin: dkpro/dkpro-jwpl

/**
 * A call of this method should validate the positions of the panels
 * components.
 */
@Override
public void relocate()
{
  int w = 360, h = 165;
  int x = (this.getWidth() - w) / 2, y = (this.getHeight() - h) / 2;
  verifyDiffCheckBox.setLocation(x, y);
  verifyEncodingCheckBox.setLocation(x, y + 30);
  statsOutputCheckBox.setLocation(x, y + 70);
  debugOuputCheckBox.setLocation(x, y + 110);
  debugOutputLabel.setLocation(x, y + 140);
  debugOutputField.setLocation(x + 110, y + 140);
}

代码示例来源:origin: de.tudarmstadt.ukp.wikipedia/de.tudarmstadt.ukp.wikipedia.revisionmachine

/**
 * A call of this method should validate the positions of the panels
 * components.
 */
@Override
public void relocate()
{
  int w = 360, h = 165;
  int x = (this.getWidth() - w) / 2, y = (this.getHeight() - h) / 2;
  verifyDiffCheckBox.setLocation(x, y);
  verifyEncodingCheckBox.setLocation(x, y + 30);
  statsOutputCheckBox.setLocation(x, y + 70);
  debugOuputCheckBox.setLocation(x, y + 110);
  debugOutputLabel.setLocation(x, y + 140);
  debugOutputField.setLocation(x + 110, y + 140);
}

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

@Override
public void doLayout() {
  Dimension d_check = check == null ? new Dimension(0, 0) : check.getPreferredSize();
  Dimension d_label = stringDisplayer == null ? new Dimension (0,0) : stringDisplayer.getPreferredSize();
  int y_check = 0;
  if (d_check.height < d_label.height) {
    y_check = (d_label.height - d_check.height) / 2;
  }
  
  if (check != null) {
    check.setLocation(0, y_check);
    check.setBounds(0, y_check, d_check.width, d_check.height);
    if (checkBounds == null)
      checkBounds = check.getBounds();
  }
}

代码示例来源:origin: protegeproject/protege

public void layoutContainer(Container parent) {
    cb.setSize(cb.getPreferredSize());
    cb.setLocation(2, 2);
    parent.getInsets();
    list.setBounds(20, 0, parent.getWidth() - 20, parent.getHeight());
    ListModel listModel = list.getModel();
    for (int i = 0; i < listModel.getSize(); i++) {
      JCheckBox cb = item2CheckBoxMap.get(listModel.getElementAt(i));
      if (cb != null) {
        Rectangle bounds = list.getCellBounds(i, i);
        cb.setBounds(0, bounds.y, bounds.height + 20, bounds.height);
      }
    }
  }
}

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

@Override
public void doLayout() {
  Dimension dCheck = check.getPreferredSize();
  Dimension dLabel = stringDisplayer.getPreferredSize();
  int yCheck = 0;
  if (dCheck.height < dLabel.height) {
    yCheck = (dLabel.height - dCheck.height) / 2;
  }
  check.setLocation(0, yCheck);
  check.setBounds(0, yCheck, dCheck.width, dCheck.height);
  if (checkBounds == null) {
    checkBounds = check.getBounds();
  }
}

代码示例来源:origin: edu.stanford.protege/org.protege.editor.core.application

public void layoutContainer(Container parent) {
    cb.setSize(cb.getPreferredSize());
    cb.setLocation(2, 2);
    parent.getInsets();
    list.setBounds(20, 0, parent.getWidth() - 20, parent.getHeight());
    ListModel listModel = list.getModel();
    for (int i = 0; i < listModel.getSize(); i++) {
      JCheckBox cb = item2CheckBoxMap.get(listModel.getElementAt(i));
      if (cb != null) {
        Rectangle bounds = list.getCellBounds(i, i);
        cb.setBounds(0, bounds.y, bounds.height + 20, bounds.height);
      }
    }
  }
}

代码示例来源:origin: org.protege/protege-editor-core-application

public void layoutContainer(Container parent) {
    cb.setSize(cb.getPreferredSize());
    cb.setLocation(2, 2);
    parent.getInsets();
    list.setBounds(20, 0, parent.getWidth() - 20, parent.getHeight());
    ListModel listModel = list.getModel();
    for (int i = 0; i < listModel.getSize(); i++) {
      JCheckBox cb = item2CheckBoxMap.get(listModel.getElementAt(i));
      if (cb != null) {
        Rectangle bounds = list.getCellBounds(i, i);
        cb.setBounds(0, bounds.y, bounds.height + 20, bounds.height);
      }
    }
  }
}

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

checkBox.setLocation(0, 0);
checkBox.setSize(checkBox.getPreferredSize());
int x = 0;

代码示例来源:origin: dkpro/dkpro-jwpl

/**
 * A call of this method should validate the positions of the panels
 * components.
 */
@Override
public void relocate()
{
  int w = 360, h = 245;
  int x = (this.getWidth() - w) / 2;
  int y = (this.getHeight() - h) / 2;
  outputLabel.setLocation(x, y);
  outputPathField.setLocation(x + 160, y);
  enableZipEncodingCompression.setLocation(x + 110, y + 40);
  outputCompression.setLocation(x + 110, y + 75);
  disableOutputCompression.setLocation(x + 110, y + 100);
  enableBZip2OutputCompression.setLocation(x + 110, y + 120);
  enable7ZipOutputCompression.setLocation(x + 110, y + 140);
  activateDataFileOutput.setLocation(x + 110, y + 160);
  enableMultipleOutputFiles.setLocation(x, y + 190);
  outputSizeLimitLabel.setLocation(x, y + 220);
  outputSizeLimitField.setLocation(x + 160, y + 220);
}

代码示例来源:origin: de.tudarmstadt.ukp.wikipedia/de.tudarmstadt.ukp.wikipedia.revisionmachine

/**
 * A call of this method should validate the positions of the panels
 * components.
 */
@Override
public void relocate()
{
  int w = 360, h = 245;
  int x = (this.getWidth() - w) / 2;
  int y = (this.getHeight() - h) / 2;
  outputLabel.setLocation(x, y);
  outputPathField.setLocation(x + 160, y);
  enableZipEncodingCompression.setLocation(x + 110, y + 40);
  outputCompression.setLocation(x + 110, y + 75);
  disableOutputCompression.setLocation(x + 110, y + 100);
  enableBZip2OutputCompression.setLocation(x + 110, y + 120);
  enable7ZipOutputCompression.setLocation(x + 110, y + 140);
  activateDataFileOutput.setLocation(x + 110, y + 160);
  enableMultipleOutputFiles.setLocation(x, y + 190);
  outputSizeLimitLabel.setLocation(x, y + 220);
  outputSizeLimitField.setLocation(x + 160, y + 220);
}

代码示例来源:origin: Jamling/SmartIM

@Override
public void doLayout() {
  Dimension dCheck = check.getPreferredSize();
  Dimension dLabel = label.getPreferredSize();
  int yCheck = 0;
  int yLabel = 0;
  if (dCheck.height < dLabel.height)
    yCheck = (dLabel.height - dCheck.height) / 2;
  else
    yLabel = (dCheck.height - dLabel.height) / 2;
  check.setLocation(0, yCheck);
  check.setBounds(0, yCheck, dCheck.width, dCheck.height);
  label.setLocation(dCheck.width, yLabel);
  label.setBounds(dCheck.width, yLabel, dLabel.width, dLabel.height);
}

代码示例来源:origin: org.n52.wps/52n-wps-install-wizard

public void doLayout() {
 Dimension d_check = check.getPreferredSize();
 Dimension d_label = label.getPreferredSize();
 int y_check = 0;
 int y_label = 0;
 if (d_check.height < d_label.height) {
  y_check = (d_label.height - d_check.height)/2;
 } else {
  y_label = (d_check.height - d_label.height)/2;
 }
 check.setLocation(0,y_check);
 check.setBounds(0,y_check,d_check.width,d_check.height);
 label.setLocation(d_check.width,y_label);    
 label.setBounds(d_check.width,y_label,d_label.width,d_label.height);    
}

代码示例来源:origin: org.icepdf.os/icepdf-viewer

public void doLayout() {
  Dimension dCheck = checkBox.getPreferredSize();
  Dimension dLabel = treeLabel.getPreferredSize();
  int yCheck = 0;
  int yLabel = 0;
  if (dCheck.height < dLabel.height) {
    yCheck = (dLabel.height - dCheck.height) / 2;
  } else {
    yLabel = (dCheck.height - dLabel.height) / 2;
  }
  checkBox.setLocation(0, yCheck);
  checkBox.setBounds(0, yCheck, dCheck.width, dCheck.height);
  treeLabel.setLocation(dCheck.width, yLabel);
  treeLabel.setBounds(dCheck.width, yLabel, dLabel.width, dLabel.height);
}

代码示例来源:origin: igniterealtime/Spark

public void doLayout() {
  Dimension d_check = check.getPreferredSize();
  Dimension d_label = label.getPreferredSize();
  int y_check = 0;
  int y_label = 0;
  if (d_check.height < d_label.height) {
    y_check = (d_label.height - d_check.height) / 2;
  }
  else {
    y_label = (d_check.height - d_label.height) / 2;
  }
  check.setLocation(0, y_check);
  check.setBounds(0, y_check, d_check.width, d_check.height);
  label.setLocation(d_check.width, y_label);
  label.setBounds(d_check.width, y_label, d_label.width, d_label.height);
}

代码示例来源:origin: de.tudarmstadt.ukp.wikipedia/de.tudarmstadt.ukp.wikipedia.revisionmachine

/**
 * A call of this method should validate the positions of the panels
 * components.
 */
@Override
public void relocate()
{
  int w = 200, h = 235;
  int x = (this.getWidth() - w) / 2;
  int y = (this.getHeight() - h) / 2;
  enableSQLDatabaseConnection.setLocation(x, y);
  sqlHostLabel.setLocation(x, y + 40);
  sqlHostField.setLocation(x + 110, y + 40);
  sqlDatabaseLabel.setLocation(x, y + 70);
  sqlDatabaseField.setLocation(x + 110, y + 70);
  sqlUserLabel.setLocation(x, y + 100);
  sqlUserField.setLocation(x + 110, y + 100);
  sqlPasswordLabel.setLocation(x, y + 130);
  sqlPasswordField.setLocation(x + 110, y + 130);
  enableZipEncodingCheckBox.setLocation(x, y + 180);
}

代码示例来源:origin: dkpro/dkpro-jwpl

/**
 * A call of this method should validate the positions of the panels
 * components.
 */
@Override
public void relocate()
{
  int w = 200, h = 235;
  int x = (this.getWidth() - w) / 2;
  int y = (this.getHeight() - h) / 2;
  enableSQLDatabaseConnection.setLocation(x, y);
  sqlHostLabel.setLocation(x, y + 40);
  sqlHostField.setLocation(x + 110, y + 40);
  sqlDatabaseLabel.setLocation(x, y + 70);
  sqlDatabaseField.setLocation(x + 110, y + 70);
  sqlUserLabel.setLocation(x, y + 100);
  sqlUserField.setLocation(x + 110, y + 100);
  sqlPasswordLabel.setLocation(x, y + 130);
  sqlPasswordField.setLocation(x + 110, y + 130);
  enableZipEncodingCheckBox.setLocation(x, y + 180);
}

代码示例来源:origin: dkpro/dkpro-jwpl

/**
 * A call of this method should validate the positions of the panels
 * components.
 */
@Override
public void relocate()
{
  int w = 550, h = 210;
  int x = (this.getWidth() - w) / 2;
  int y = (this.getHeight() - h) / 2;
  // 10, 10 <-> 580, 185
  executablePathLabel.setLocation(x, y);
  sevenZipEnableBox.setLocation(x, y + 35);
  sevenZipLabel.setLocation(x + 30, y + 35);
  sevenZipPathField.setLocation(x + 160, y + 35);
  sevenZipSearchButton.setLocation(x + 470, y + 35);
}

代码示例来源:origin: de.tudarmstadt.ukp.wikipedia/de.tudarmstadt.ukp.wikipedia.revisionmachine

/**
 * A call of this method should validate the positions of the panels
 * components.
 */
@Override
public void relocate()
{
  int w = 550, h = 210;
  int x = (this.getWidth() - w) / 2;
  int y = (this.getHeight() - h) / 2;
  // 10, 10 <-> 580, 185
  executablePathLabel.setLocation(x, y);
  sevenZipEnableBox.setLocation(x, y + 35);
  sevenZipLabel.setLocation(x + 30, y + 35);
  sevenZipPathField.setLocation(x + 160, y + 35);
  sevenZipSearchButton.setLocation(x + 470, y + 35);
}

相关文章

JCheckBox类方法