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

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

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

JTextField.setPreferredSize介绍

暂无

代码示例

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

jtf.setPreferredSize(new Dimension(100, 25));
search.add(jtf, BorderLayout.CENTER);
search.add(showSettingCheck, BorderLayout.EAST);

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

protected JTextField getSampleTextField() {
  if (sampleText == null) {
    Border lowered = BorderFactory.createLoweredBevelBorder();
    sampleText = new JTextField(("AaBbYyZz"));
    sampleText.setHorizontalAlignment(JTextField.CENTER);
    sampleText.setBorder(lowered);
    sampleText.setPreferredSize(new Dimension(300, 100));
  }
  return sampleText;
}

代码示例来源:origin: stanfordnlp/CoreNLP

urlTextField.setPreferredSize(new java.awt.Dimension(300, 20));
urlTextField.getDocument().addDocumentListener(new DocumentListener() {
 public void changedUpdate(DocumentEvent e) {

代码示例来源:origin: stanfordnlp/CoreNLP

JLabel encodingLabel = new JLabel("Character encoding: ");
setEncoding = new JTextField(Preferences.getEncoding());
setEncoding.setPreferredSize(headfinderName.getPreferredSize());
advOptions.add(headfinderName);
advOptions.add(headfinderPicker);

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

txtField.setPreferredSize(new Dimension(200, 30));
txtField.setBackground(Color.white);
input.add(txtField);

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

input.setPreferredSize(new Dimension(35, 30));
input.setBorder(new EmptyBorder(5, 5, 5, 5));
((AbstractDocument) input.getDocument()).setDocumentFilter(new DocumentFilter()

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

JPanel displayPanel = new JPanel();
 // JPanel displayPanel = new JPanel( new GridLayout( 4, 2 ) );
 // JPanel displayPanel = new JPanel( new BorderLayout() );
 // JPanel displayPanel = new JPanel( new GridBagLayout() );
 JTextField titleText = new JTextField( "title" );
 titleText.setPreferredSize( new Dimension( 200, 24 ) );
 // For FlowLayout and GridLayout, uncomment:
 displayPanel.add( titleText );
 // For BorderLayout, uncomment:
 // displayPanel.add( titleText, BorderLayout.NORTH );
 // For GridBagLayout, uncomment:
 // displayPanel.add( titleText, new GridBagConstraints( 0, 0, 1, 1, 1.0,
 // 1.0, GridBagConstraints.CENTER, GridBagConstraints.NONE,
 // new Insets( 0, 0, 0, 0 ), 0, 0 ) );

代码示例来源:origin: apache/pdfbox

final JLabel label = new JLabel("Index to go:");
final JTextField field = new JFormattedTextField(NumberFormat.getIntegerInstance());
field.setPreferredSize(new Dimension(100, 20));

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

public FileControl(String nodePath, Port port) {
  super(nodePath, port);
  setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0));
  fileField = new JTextField();
  fileField.putClientProperty("JComponent.sizeVariant", "small");
  fileField.setPreferredSize(new Dimension(150, 19));
  fileField.setEditable(false);
  fileField.setFont(Theme.SMALL_BOLD_FONT);
  chooseButton = new JButton("...");
  chooseButton.putClientProperty("JButton.buttonType", "gradient");
  chooseButton.setPreferredSize(new Dimension(30, 27));
  chooseButton.addActionListener(this);
  add(fileField);
  add(chooseButton);
  setValueForControl(port.getValue());
}

代码示例来源:origin: apache/pdfbox

tintField.setPreferredSize(new Dimension(10, 30));
gbc.gridx = 1;
gbc.weightx = 0.5;

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

txtMessage.setMinimumSize(new java.awt.Dimension(6, 70));
txtMessage.setName(""); // NOI18N
txtMessage.setPreferredSize(new java.awt.Dimension(6, 70));
txtMessage.addKeyListener(new java.awt.event.KeyAdapter() {
  public void keyTyped(java.awt.event.KeyEvent evt) {

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

filterFld.setPreferredSize(new Dimension(CONTROL_WIDTH, 20));
filterFld
    .getDocument()

代码示例来源:origin: fossasia/neurolab-desktop

public void removeUpdate(DocumentEvent arg0) {save();}
});
ipText.setPreferredSize(new Dimension((int)(oscWidth/2.3) , 14));

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

public void changeGUISize(Font font) {
  txtConversation.setFont(font);
  txtMessage.setFont(font);
  if (jScrollPaneTxt != null) {
    jScrollPaneTxt.setFont(font);
    jScrollPaneTxt.getVerticalScrollBar().setPreferredSize(new Dimension(GUISizeHelper.scrollBarSize, 0));
    jScrollPaneTxt.getHorizontalScrollBar().setPreferredSize(new Dimension(0, GUISizeHelper.scrollBarSize));
  }
  int height = 30;
  if (font.getSize() > 20) {
    height = 30 + Math.min(font.getSize() - 10, 30);
  }
  txtMessage.setMinimumSize(new Dimension(20, height));
  txtMessage.setMaximumSize(new Dimension(txtMessage.getWidth(), height));
  txtMessage.setPreferredSize(new Dimension(txtMessage.getWidth(), height));
  txtMessage.setSize(new Dimension(txtMessage.getWidth(), height));
  if (connectedChat != null) {
    connectedChat.changeGUISize(font);
  }
}

代码示例来源:origin: fossasia/neurolab-desktop

public void removeUpdate(DocumentEvent arg0) {save();}
});
addressText.setPreferredSize(new Dimension((int)(serialWidth/2.3) , 14));

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

fileNameField.setText(new File(getFileName()).getName());
fileNameField.setEditable(false);
fileNameField.setPreferredSize(new Dimension(100, fileNameField.getHeight()));

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

portNumberField.setPreferredSize(new Dimension(70, portNumberField.getHeight()));
portNumberField.setMinimumSize(new Dimension(70, portNumberField.getHeight()));

代码示例来源:origin: ron190/jsql-injection

(int) inputCustomFromRow.getPreferredSize().getHeight()
);
inputCustomFromRow.setPreferredSize(d);
final JTextField inputCustomToRow = new JPopupTextField("no.", "65565").getProxy();
inputCustomToRow.setHorizontalAlignment(JTextField.TRAILING);
inputCustomToRow.setPreferredSize(d);
final JTextField inputCustomFromChar = new JPopupTextField("no.", "1").getProxy();
inputCustomFromChar.setHorizontalAlignment(JTextField.TRAILING);
inputCustomFromChar.setPreferredSize(d);
final JTextField inputCustomToChar = new JPopupTextField("no.", "65565").getProxy();
inputCustomToChar.setHorizontalAlignment(JTextField.TRAILING);
inputCustomToChar.setPreferredSize(d);

代码示例来源:origin: RaiMan/SikuliX2

status.setMinimumSize(new Dimension(tableW, 30));
status.setMaximumSize(new Dimension(tableW, 30));
status.setPreferredSize(new Dimension(tableW, 30));
panel.add(status);

代码示例来源:origin: ron190/jsql-injection

this.textFieldRequest.setPreferredSize(new Dimension(0, 27));
this.textFieldRequest.setFont(HelperUi.FONT_SEGOE_BIG);
this.textFieldHeader.setPreferredSize(new Dimension(0, 27));
this.textFieldHeader.setFont(HelperUi.FONT_SEGOE_BIG);

相关文章

JTextField类方法