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

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

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

JTextField.setLocation介绍

暂无

代码示例

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

JTextField textField = new JTextField(2);
textField.setSize( textField.getPreferredSize() );
textField.setLocation( mouseEvent.getPoint() );
panel.add( textField );
panel.repaint();

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

public JPanel createContentPane() {
  buttonPanel = new JPanel();
  buttonPanel.setLayout(null);
  buttonPanel.setLocation(10, 50);
  buttonPanel.setSize(1370, 770);

  JButton Button1 = new JButton("Button 1");
  Button1.setLocation(0, 0);
  Button1.setSize(120, 30);
  buttonPanel.add(Button1);

  JTextField a = new JTextField(20);
  a.setLocation(125, 0);
  a.setSize(120, 30);
  buttonPanel.add(a);

  return buttonPanel;
}

代码示例来源:origin: edu.illinois.cs.cogcomp/DatalessClassification

public View(Controller controller){
  window = new JFrame("DatalessHC");
  window.setSize(800, 600);
  myPanel = new JPanel();
  myPanel.setPreferredSize(new Dimension(400,400));
  myPanel.setLayout(null);
  JButton simple_esa=new JButton("Simple ESA");
  simple_esa.setBounds(30,50,150,30);
  simple_esa.addActionListener(simple_esa(controller));
  myPanel.add(simple_esa);
  JButton classify=new JButton("Text Classification");
  classify.setBounds(30,100,150,30);
  classify.addActionListener(classify(controller));
  myPanel.add(classify);
  word = new JTextField("Enter Single Word");
  word.setSize(200,30);
  word.setLocation(200, 50);
  myPanel.add(word);
  window.setContentPane(myPanel);
  window.setVisible(true);
  window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}

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

/**
 * A call of this method should validate the positions of the panels
 * components.
 */
@Override
public void relocate()
{
  int w = 380, h = 65;
  int x = (this.getWidth() - w) / 2, y = (this.getHeight() - h) / 2;
  fullRevisionLabel.setLocation(x, y);
  fullRevisionField.setLocation(x + 280, y);
  minimumCommonSequenceLabel.setLocation(x, y + 40);
  minimumCommonSequenceField.setLocation(x + 280, y + 40);
}

代码示例来源: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 = 380, h = 65;
  int x = (this.getWidth() - w) / 2, y = (this.getHeight() - h) / 2;
  fullRevisionLabel.setLocation(x, y);
  fullRevisionField.setLocation(x + 280, y);
  minimumCommonSequenceLabel.setLocation(x, y + 40);
  minimumCommonSequenceField.setLocation(x + 280, y + 40);
}

代码示例来源: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: 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 = 310, h = 255;
  int x = (this.getWidth() - w) / 2, y = (this.getHeight() - h) / 2;
  taskLimitationsLabel.setLocation(x, y);
  articleTaskLabel.setLocation(x, y + 30);
  articleTaskLimitField.setLocation(x + 110, y + 30);
  diffTaskLabel.setLocation(x, y + 60);
  diffTaskLimitField.setLocation(x + 110, y + 60);
  sqlProducerLimitationsLabel.setLocation(x, y + 100);
  maxAllowedPacketLabel.setLocation(x, y + 130);
  maxAllowedPacketField.setLocation(x + 170, y + 130);
}

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

/**
 * A call of this method should validate the positions of the panels
 * components.
 */
@Override
public void relocate()
{
  int w = 310, h = 255;
  int x = (this.getWidth() - w) / 2, y = (this.getHeight() - h) / 2;
  taskLimitationsLabel.setLocation(x, y);
  articleTaskLabel.setLocation(x, y + 30);
  articleTaskLimitField.setLocation(x + 110, y + 30);
  diffTaskLabel.setLocation(x, y + 60);
  diffTaskLimitField.setLocation(x + 110, y + 60);
  sqlProducerLimitationsLabel.setLocation(x, y + 100);
  maxAllowedPacketLabel.setLocation(x, y + 130);
  maxAllowedPacketField.setLocation(x + 170, y + 130);
}

代码示例来源: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 = 480, h = 245;
  int x = (this.getWidth() - w) / 2, y = (this.getHeight() - h) / 2;
  diffToolLabel.setLocation(x, y);
  diffToolField.setLocation(x + 160, y);
  diffToolLogLevelComboBox.setLocation(x + 380, y);
}

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

/**
 * A call of this method should validate the positions of the panels
 * components.
 */
@Override
public void relocate()
{
  int w = 480, h = 245;
  int x = (this.getWidth() - w) / 2, y = (this.getHeight() - h) / 2;
  diffToolLabel.setLocation(x, y);
  diffToolField.setLocation(x + 160, y);
  diffToolLogLevelComboBox.setLocation(x + 380, y);
}

代码示例来源:origin: Var3D/var3dframe

public void setSize(int w,int h){
  super.setSize(w,h);
  panel.setSize(w,h);
  if(nativeTextField==null||nativeTextField.getBorderStyle()!= NativeTextField.BorderStyle.RoundedRect){
    textField.setSize(getWidth(),getHeight());
    textField.setLocation(0,0);
    textMessage.setSize(getWidth(),getHeight());
    textMessage.setLocation(0,0);
  }else {
    textField.setSize(getWidth(),getHeight()-18);
    textField.setLocation(0,9);
    textMessage.setSize(getWidth(),getHeight()-18);
    textMessage.setLocation(0,9);
  }
}

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

/**
 * A call of this method should validate the positions of the panels
 * components.
 */
@Override
public void relocate()
{
  int w = 250, h = 185;
  int x = (this.getWidth() - w) / 2, y = (this.getHeight() - h) / 2;
  pathLabel.setLocation(x, y);
  pathField.setLocation(x, y + 30);
  searchButton.setLocation(x + 170, y);
  typeLabel.setLocation(x, y + 70);
  typeChooser.setLocation(x + 140, y + 70);
  startLabel.setLocation(x, y + 110);
  startPosition.setLocation(x + 140, y + 110);
  addButton.setLocation(x, y + 160);
  cancelButton.setLocation(x + 130, y + 160);
}

代码示例来源: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 = 250, h = 185;
  int x = (this.getWidth() - w) / 2, y = (this.getHeight() - h) / 2;
  pathLabel.setLocation(x, y);
  pathField.setLocation(x, y + 30);
  searchButton.setLocation(x + 170, y);
  typeLabel.setLocation(x, y + 70);
  typeChooser.setLocation(x + 140, y + 70);
  startLabel.setLocation(x, y + 110);
  startPosition.setLocation(x + 140, y + 110);
  addButton.setLocation(x, y + 160);
  cancelButton.setLocation(x + 130, y + 160);
}

代码示例来源: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: 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 = 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: dkpro/dkpro-jwpl

/**
 * A call of this method should validate the positions of the panels
 * components.
 */
@Override
public void relocate()
{
  int w = 555, h = 235;
  int x = (this.getWidth() - w) / 2, y = (this.getHeight() - h) / 2;
  archiveScrollPane.setLocation(x, y);
  addArchiveButton.setLocation(x + 435, y + 10);
  removeArchiveButton.setLocation(x + 435, y + 40);
  encodingLabel.setLocation(x, y + 220);
  encodingField.setLocation(x + 210, y + 220);
  surrogatePanel.setLocation(x + 415, y + 85);
}

代码示例来源: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 = 555, h = 235;
  int x = (this.getWidth() - w) / 2, y = (this.getHeight() - h) / 2;
  archiveScrollPane.setLocation(x, y);
  addArchiveButton.setLocation(x + 435, y + 10);
  removeArchiveButton.setLocation(x + 435, y + 40);
  encodingLabel.setLocation(x, y + 220);
  encodingField.setLocation(x + 210, y + 220);
  surrogatePanel.setLocation(x + 415, y + 85);
}

代码示例来源: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);
}

相关文章

微信公众号

最新文章

更多

JTextField类方法