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

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

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

JCheckBox.setLocation介绍

暂无

代码示例

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

  1. /**
  2. * A call of this method should validate the positions of the panels
  3. * components.
  4. */
  5. @Override
  6. public void relocate()
  7. {
  8. int w = 360, h = 165;
  9. int x = (this.getWidth() - w) / 2, y = (this.getHeight() - h) / 2;
  10. verifyDiffCheckBox.setLocation(x, y);
  11. verifyEncodingCheckBox.setLocation(x, y + 30);
  12. statsOutputCheckBox.setLocation(x, y + 70);
  13. debugOuputCheckBox.setLocation(x, y + 110);
  14. debugOutputLabel.setLocation(x, y + 140);
  15. debugOutputField.setLocation(x + 110, y + 140);
  16. }

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

  1. /**
  2. * A call of this method should validate the positions of the panels
  3. * components.
  4. */
  5. @Override
  6. public void relocate()
  7. {
  8. int w = 360, h = 165;
  9. int x = (this.getWidth() - w) / 2, y = (this.getHeight() - h) / 2;
  10. verifyDiffCheckBox.setLocation(x, y);
  11. verifyEncodingCheckBox.setLocation(x, y + 30);
  12. statsOutputCheckBox.setLocation(x, y + 70);
  13. debugOuputCheckBox.setLocation(x, y + 110);
  14. debugOutputLabel.setLocation(x, y + 140);
  15. debugOutputField.setLocation(x + 110, y + 140);
  16. }

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

  1. @Override
  2. public void doLayout() {
  3. Dimension d_check = check == null ? new Dimension(0, 0) : check.getPreferredSize();
  4. Dimension d_label = stringDisplayer == null ? new Dimension (0,0) : stringDisplayer.getPreferredSize();
  5. int y_check = 0;
  6. if (d_check.height < d_label.height) {
  7. y_check = (d_label.height - d_check.height) / 2;
  8. }
  9. if (check != null) {
  10. check.setLocation(0, y_check);
  11. check.setBounds(0, y_check, d_check.width, d_check.height);
  12. if (checkBounds == null)
  13. checkBounds = check.getBounds();
  14. }
  15. }

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

  1. public void layoutContainer(Container parent) {
  2. cb.setSize(cb.getPreferredSize());
  3. cb.setLocation(2, 2);
  4. parent.getInsets();
  5. list.setBounds(20, 0, parent.getWidth() - 20, parent.getHeight());
  6. ListModel listModel = list.getModel();
  7. for (int i = 0; i < listModel.getSize(); i++) {
  8. JCheckBox cb = item2CheckBoxMap.get(listModel.getElementAt(i));
  9. if (cb != null) {
  10. Rectangle bounds = list.getCellBounds(i, i);
  11. cb.setBounds(0, bounds.y, bounds.height + 20, bounds.height);
  12. }
  13. }
  14. }
  15. }

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

  1. @Override
  2. public void doLayout() {
  3. Dimension dCheck = check.getPreferredSize();
  4. Dimension dLabel = stringDisplayer.getPreferredSize();
  5. int yCheck = 0;
  6. if (dCheck.height < dLabel.height) {
  7. yCheck = (dLabel.height - dCheck.height) / 2;
  8. }
  9. check.setLocation(0, yCheck);
  10. check.setBounds(0, yCheck, dCheck.width, dCheck.height);
  11. if (checkBounds == null) {
  12. checkBounds = check.getBounds();
  13. }
  14. }

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

  1. public void layoutContainer(Container parent) {
  2. cb.setSize(cb.getPreferredSize());
  3. cb.setLocation(2, 2);
  4. parent.getInsets();
  5. list.setBounds(20, 0, parent.getWidth() - 20, parent.getHeight());
  6. ListModel listModel = list.getModel();
  7. for (int i = 0; i < listModel.getSize(); i++) {
  8. JCheckBox cb = item2CheckBoxMap.get(listModel.getElementAt(i));
  9. if (cb != null) {
  10. Rectangle bounds = list.getCellBounds(i, i);
  11. cb.setBounds(0, bounds.y, bounds.height + 20, bounds.height);
  12. }
  13. }
  14. }
  15. }

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

  1. public void layoutContainer(Container parent) {
  2. cb.setSize(cb.getPreferredSize());
  3. cb.setLocation(2, 2);
  4. parent.getInsets();
  5. list.setBounds(20, 0, parent.getWidth() - 20, parent.getHeight());
  6. ListModel listModel = list.getModel();
  7. for (int i = 0; i < listModel.getSize(); i++) {
  8. JCheckBox cb = item2CheckBoxMap.get(listModel.getElementAt(i));
  9. if (cb != null) {
  10. Rectangle bounds = list.getCellBounds(i, i);
  11. cb.setBounds(0, bounds.y, bounds.height + 20, bounds.height);
  12. }
  13. }
  14. }
  15. }

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

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

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

  1. /**
  2. * A call of this method should validate the positions of the panels
  3. * components.
  4. */
  5. @Override
  6. public void relocate()
  7. {
  8. int w = 360, h = 245;
  9. int x = (this.getWidth() - w) / 2;
  10. int y = (this.getHeight() - h) / 2;
  11. outputLabel.setLocation(x, y);
  12. outputPathField.setLocation(x + 160, y);
  13. enableZipEncodingCompression.setLocation(x + 110, y + 40);
  14. outputCompression.setLocation(x + 110, y + 75);
  15. disableOutputCompression.setLocation(x + 110, y + 100);
  16. enableBZip2OutputCompression.setLocation(x + 110, y + 120);
  17. enable7ZipOutputCompression.setLocation(x + 110, y + 140);
  18. activateDataFileOutput.setLocation(x + 110, y + 160);
  19. enableMultipleOutputFiles.setLocation(x, y + 190);
  20. outputSizeLimitLabel.setLocation(x, y + 220);
  21. outputSizeLimitField.setLocation(x + 160, y + 220);
  22. }

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

  1. /**
  2. * A call of this method should validate the positions of the panels
  3. * components.
  4. */
  5. @Override
  6. public void relocate()
  7. {
  8. int w = 360, h = 245;
  9. int x = (this.getWidth() - w) / 2;
  10. int y = (this.getHeight() - h) / 2;
  11. outputLabel.setLocation(x, y);
  12. outputPathField.setLocation(x + 160, y);
  13. enableZipEncodingCompression.setLocation(x + 110, y + 40);
  14. outputCompression.setLocation(x + 110, y + 75);
  15. disableOutputCompression.setLocation(x + 110, y + 100);
  16. enableBZip2OutputCompression.setLocation(x + 110, y + 120);
  17. enable7ZipOutputCompression.setLocation(x + 110, y + 140);
  18. activateDataFileOutput.setLocation(x + 110, y + 160);
  19. enableMultipleOutputFiles.setLocation(x, y + 190);
  20. outputSizeLimitLabel.setLocation(x, y + 220);
  21. outputSizeLimitField.setLocation(x + 160, y + 220);
  22. }

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

  1. @Override
  2. public void doLayout() {
  3. Dimension dCheck = check.getPreferredSize();
  4. Dimension dLabel = label.getPreferredSize();
  5. int yCheck = 0;
  6. int yLabel = 0;
  7. if (dCheck.height < dLabel.height)
  8. yCheck = (dLabel.height - dCheck.height) / 2;
  9. else
  10. yLabel = (dCheck.height - dLabel.height) / 2;
  11. check.setLocation(0, yCheck);
  12. check.setBounds(0, yCheck, dCheck.width, dCheck.height);
  13. label.setLocation(dCheck.width, yLabel);
  14. label.setBounds(dCheck.width, yLabel, dLabel.width, dLabel.height);
  15. }

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

  1. public void doLayout() {
  2. Dimension d_check = check.getPreferredSize();
  3. Dimension d_label = label.getPreferredSize();
  4. int y_check = 0;
  5. int y_label = 0;
  6. if (d_check.height < d_label.height) {
  7. y_check = (d_label.height - d_check.height)/2;
  8. } else {
  9. y_label = (d_check.height - d_label.height)/2;
  10. }
  11. check.setLocation(0,y_check);
  12. check.setBounds(0,y_check,d_check.width,d_check.height);
  13. label.setLocation(d_check.width,y_label);
  14. label.setBounds(d_check.width,y_label,d_label.width,d_label.height);
  15. }

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

  1. public void doLayout() {
  2. Dimension dCheck = checkBox.getPreferredSize();
  3. Dimension dLabel = treeLabel.getPreferredSize();
  4. int yCheck = 0;
  5. int yLabel = 0;
  6. if (dCheck.height < dLabel.height) {
  7. yCheck = (dLabel.height - dCheck.height) / 2;
  8. } else {
  9. yLabel = (dCheck.height - dLabel.height) / 2;
  10. }
  11. checkBox.setLocation(0, yCheck);
  12. checkBox.setBounds(0, yCheck, dCheck.width, dCheck.height);
  13. treeLabel.setLocation(dCheck.width, yLabel);
  14. treeLabel.setBounds(dCheck.width, yLabel, dLabel.width, dLabel.height);
  15. }

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

  1. public void doLayout() {
  2. Dimension d_check = check.getPreferredSize();
  3. Dimension d_label = label.getPreferredSize();
  4. int y_check = 0;
  5. int y_label = 0;
  6. if (d_check.height < d_label.height) {
  7. y_check = (d_label.height - d_check.height) / 2;
  8. }
  9. else {
  10. y_label = (d_check.height - d_label.height) / 2;
  11. }
  12. check.setLocation(0, y_check);
  13. check.setBounds(0, y_check, d_check.width, d_check.height);
  14. label.setLocation(d_check.width, y_label);
  15. label.setBounds(d_check.width, y_label, d_label.width, d_label.height);
  16. }

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

  1. /**
  2. * A call of this method should validate the positions of the panels
  3. * components.
  4. */
  5. @Override
  6. public void relocate()
  7. {
  8. int w = 200, h = 235;
  9. int x = (this.getWidth() - w) / 2;
  10. int y = (this.getHeight() - h) / 2;
  11. enableSQLDatabaseConnection.setLocation(x, y);
  12. sqlHostLabel.setLocation(x, y + 40);
  13. sqlHostField.setLocation(x + 110, y + 40);
  14. sqlDatabaseLabel.setLocation(x, y + 70);
  15. sqlDatabaseField.setLocation(x + 110, y + 70);
  16. sqlUserLabel.setLocation(x, y + 100);
  17. sqlUserField.setLocation(x + 110, y + 100);
  18. sqlPasswordLabel.setLocation(x, y + 130);
  19. sqlPasswordField.setLocation(x + 110, y + 130);
  20. enableZipEncodingCheckBox.setLocation(x, y + 180);
  21. }

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

  1. /**
  2. * A call of this method should validate the positions of the panels
  3. * components.
  4. */
  5. @Override
  6. public void relocate()
  7. {
  8. int w = 200, h = 235;
  9. int x = (this.getWidth() - w) / 2;
  10. int y = (this.getHeight() - h) / 2;
  11. enableSQLDatabaseConnection.setLocation(x, y);
  12. sqlHostLabel.setLocation(x, y + 40);
  13. sqlHostField.setLocation(x + 110, y + 40);
  14. sqlDatabaseLabel.setLocation(x, y + 70);
  15. sqlDatabaseField.setLocation(x + 110, y + 70);
  16. sqlUserLabel.setLocation(x, y + 100);
  17. sqlUserField.setLocation(x + 110, y + 100);
  18. sqlPasswordLabel.setLocation(x, y + 130);
  19. sqlPasswordField.setLocation(x + 110, y + 130);
  20. enableZipEncodingCheckBox.setLocation(x, y + 180);
  21. }

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

  1. /**
  2. * A call of this method should validate the positions of the panels
  3. * components.
  4. */
  5. @Override
  6. public void relocate()
  7. {
  8. int w = 550, h = 210;
  9. int x = (this.getWidth() - w) / 2;
  10. int y = (this.getHeight() - h) / 2;
  11. // 10, 10 <-> 580, 185
  12. executablePathLabel.setLocation(x, y);
  13. sevenZipEnableBox.setLocation(x, y + 35);
  14. sevenZipLabel.setLocation(x + 30, y + 35);
  15. sevenZipPathField.setLocation(x + 160, y + 35);
  16. sevenZipSearchButton.setLocation(x + 470, y + 35);
  17. }

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

  1. /**
  2. * A call of this method should validate the positions of the panels
  3. * components.
  4. */
  5. @Override
  6. public void relocate()
  7. {
  8. int w = 550, h = 210;
  9. int x = (this.getWidth() - w) / 2;
  10. int y = (this.getHeight() - h) / 2;
  11. // 10, 10 <-> 580, 185
  12. executablePathLabel.setLocation(x, y);
  13. sevenZipEnableBox.setLocation(x, y + 35);
  14. sevenZipLabel.setLocation(x + 30, y + 35);
  15. sevenZipPathField.setLocation(x + 160, y + 35);
  16. sevenZipSearchButton.setLocation(x + 470, y + 35);
  17. }

相关文章

JCheckBox类方法