本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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));
}
示例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();
}