當前位置: 首頁>>代碼示例>>Java>>正文


Java JTextField.setMinimumSize方法代碼示例

本文整理匯總了Java中javax.swing.JTextField.setMinimumSize方法的典型用法代碼示例。如果您正苦於以下問題:Java JTextField.setMinimumSize方法的具體用法?Java JTextField.setMinimumSize怎麽用?Java JTextField.setMinimumSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JTextField的用法示例。


在下文中一共展示了JTextField.setMinimumSize方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createStep2Panel

import javax.swing.JTextField; //導入方法依賴的package包/類
/**
 * Creates and returns the GUI components for step2.
 *
 * @return
 */
private Component createStep2Panel() {
	JPanel panel = new JPanel();
	panel.setLayout(new GridBagLayout());
	GridBagConstraints gbc = new GridBagConstraints();

	gbc.gridx = 0;
	gbc.gridy = 0;
	gbc.weightx = 1;
	gbc.fill = GridBagConstraints.BOTH;
	gbc.insets = new Insets(0, 51, 0, 0);

	codeText = new JTextField();
	codeText.setMinimumSize(new Dimension(80, 33));
	codeText.setPreferredSize(new Dimension(80, 33));
	panel.add(codeText, gbc);

	panel.setBorder(new RoundTitledBorder(2, I18N.getMessage(I18N.getGUIBundle(),
			"gui.dialog.oauth_dialog.copy_code.label"), false));
	return panel;
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:26,代碼來源:OAuthDialog.java

示例2: createGUI

import javax.swing.JTextField; //導入方法依賴的package包/類
protected void createGUI()
{
	GridBagLayout gridbag = new GridBagLayout();
	GridBagConstraints c = new GridBagConstraints();

	setLayout(gridbag);
	setMaximumSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE));

	target = new JTextField();
	target.setEditable(false);
	target.setMinimumSize(new Dimension(150, 20));
	target.setPreferredSize(new Dimension(150, 20));
	target.setMaximumSize(new Dimension(150, 20));
	c.gridx = 0;
	c.weightx = 1;
	c.gridy = 0;
	c.fill = GridBagConstraints.HORIZONTAL;
	gridbag.setConstraints(target, c);
	add(target);

	search = new JButton("...");
	search.setFont(new Font("Sans Serif", Font.PLAIN, 8));
	search.addActionListener(this);
	search.setMinimumSize(new Dimension(18, 20));
	search.setPreferredSize(new Dimension(18, 20));
	search.setMaximumSize(new Dimension(18, 20));

	c.gridx = 1;
	c.weightx = 0;
	gridbag.setConstraints(search, c);
	add(search);
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:33,代碼來源:WhereTargetChooser.java

示例3: createGUI

import javax.swing.JTextField; //導入方法依賴的package包/類
private void createGUI()
{
	GridBagLayout gridbag = new GridBagLayout();
	GridBagConstraints c = new GridBagConstraints();

	setLayout(gridbag);
	setMaximumSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE));

	target = new JTextField();
	target.setEditable(false);
	target.setMinimumSize(new Dimension(150, 20));
	target.setPreferredSize(new Dimension(150, 20));
	target.setMaximumSize(new Dimension(150, 20));
	c.gridx = 0;
	c.weightx = 1;
	c.gridy = 0;
	c.fill = GridBagConstraints.HORIZONTAL;
	gridbag.setConstraints(target, c);
	add(target);

	JButton search = new JButton("..."); //$NON-NLS-1$
	search.setFont(new Font("Sans Serif", Font.PLAIN, 8)); //$NON-NLS-1$
	search.addActionListener(new SearchHandler());
	search.setMinimumSize(new Dimension(18, 20));
	search.setPreferredSize(new Dimension(18, 20));
	search.setMaximumSize(new Dimension(18, 20));
	c.gridx = 1;
	c.weightx = 0;
	gridbag.setConstraints(search, c);
	add(search);
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:32,代碼來源:ScriptTargetChooser.java

示例4: initToolbarWest

import javax.swing.JTextField; //導入方法依賴的package包/類
private void initToolbarWest(JToolBar toolbar, ActionListener outputListener, boolean nbOutputComponent) {

        if (!nbOutputComponent) {
            JButton[] btns = getEditButtons();
            for (JButton btn : btns) {
                if (btn != null) {
                    toolbar.add(btn);
                }
            }
        }

        toolbar.addSeparator(new Dimension(10, 10));

        //add refresh button
        URL url = getClass().getResource(IMG_PREFIX + "refresh.png"); // NOI18N
        refreshButton = new JButton(new ImageIcon(url));
        refreshButton.setToolTipText(NbBundle.getMessage(DataViewUI.class, "TOOLTIP_refresh"));
        refreshButton.addActionListener(outputListener);
        processButton(refreshButton);

        toolbar.add(refreshButton);

        //add limit row label
        limitRow = new JLabel(NbBundle.getMessage(DataViewUI.class, "LBL_max_rows"));
        limitRow.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 8));
        toolbar.add(limitRow);

        //add refresh text field
        refreshField = new JTextField(5);
        refreshField.setMinimumSize(refreshField.getPreferredSize());
        refreshField.setMaximumSize(refreshField.getPreferredSize());
        refreshField.addFocusListener(new FocusAdapter() {
            @Override
            public void focusGained(FocusEvent e) {
                refreshField.selectAll();
            }
        });
        refreshField.addActionListener(outputListener);
        toolbar.add(refreshField);
        toolbar.addSeparator(new Dimension(10, 10));

        JLabel fetchedRowsNameLabel = new JLabel(NbBundle.getMessage(DataViewUI.class, "LBL_fetched_rows"));
        fetchedRowsNameLabel.getAccessibleContext().setAccessibleName(NbBundle.getMessage(DataViewUI.class, "LBL_fetched_rows"));
        fetchedRowsNameLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
        toolbar.add(fetchedRowsNameLabel);
        fetchedRowsLabel = new JLabel();
        toolbar.add(fetchedRowsLabel);

        toolbar.addSeparator(new Dimension(10, 10));
    }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:51,代碼來源:DataViewUI.java

示例5: TickPanel

import javax.swing.JTextField; //導入方法依賴的package包/類
public TickPanel(String value, int type) {
  super(new GridBagLayout());
  set(value);

  panelType = type;

  GridBagConstraints c = new GridBagConstraints();
  c.fill = GridBagConstraints.BOTH;
  c.ipadx = 1;
  c.weightx = 0.0;
  c.gridx = 0;
  c.gridy = 0;

  Dimension minSize;

  if (panelType == TICKS_VAL || panelType == TICKS_VALMAX) {
    valField = new JTextField(Integer.toString(numTicks));
    minSize = valField.getMinimumSize();
    minSize.width = 24;
    valField.setMinimumSize(minSize);
    valField.setPreferredSize(minSize);
    valField.addActionListener(this);
    valField.addFocusListener(this);
    add(valField, c);
    ++c.gridx;
  }
  if (panelType == TICKS_MAX || panelType == TICKS_VALMAX) {
    maxField = new JTextField(Integer.toString(maxTicks));
    minSize = maxField.getMinimumSize();
    minSize.width = 24;
    maxField.setMinimumSize(minSize);
    maxField.setPreferredSize(minSize);
    maxField.addActionListener(this);
    maxField.addFocusListener(this);
    if (panelType == TICKS_VALMAX) {
      add(new JLabel("/"), c);
      ++c.gridx;
    }
    add(maxField, c);
    ++c.gridx;
  }

  ticks = new TickLabel(numTicks, maxTicks, panelType);
  ticks.addActionListener(this);
  c.weightx = 1.0;
  add(ticks, c);
  doLayout();
}
 
開發者ID:ajmath,項目名稱:VASSAL-src,代碼行數:49,代碼來源:PropertySheet.java


注:本文中的javax.swing.JTextField.setMinimumSize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。