本文整理汇总了Java中javax.swing.JLabel.RIGHT属性的典型用法代码示例。如果您正苦于以下问题:Java JLabel.RIGHT属性的具体用法?Java JLabel.RIGHT怎么用?Java JLabel.RIGHT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.swing.JLabel
的用法示例。
在下文中一共展示了JLabel.RIGHT属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addFormField
private void addFormField(JPanel detailsPanel, String name, JComponent field)
{
JPanel tempPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 4, 2));
JLabel tempLabel = new JLabel(name, JLabel.RIGHT);
// TODO: hard sizing of labels may not scale!
final int width = new JLabel("ZEN amount to send with every message:").getPreferredSize().width + 30;
tempLabel.setPreferredSize(new Dimension(width, tempLabel.getPreferredSize().height));
tempPanel.add(tempLabel);
tempPanel.add(field);
detailsPanel.add(tempPanel);
}
示例2: addFormField
private void addFormField(JPanel detailsPanel, String name, JComponent field)
{
JPanel tempPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 4, 2));
JLabel tempLabel = new JLabel(name, JLabel.RIGHT);
// TODO: hard sizing of labels may not scale!
final int width = new JLabel("Sender identiication T address:").getPreferredSize().width + 10;
tempLabel.setPreferredSize(new Dimension(width, tempLabel.getPreferredSize().height));
tempPanel.add(tempLabel);
tempPanel.add(field);
detailsPanel.add(tempPanel);
}
示例3: addNameValue
private void addNameValue(JPanel container, String name, String value) {
JPanel panel = new JPanel();
panel.setLayout(new FlowLayout(FlowLayout.LEFT, 6, 0));
container.add(panel);
JLabel label = new JLabel(name + ":", JLabel.RIGHT);
label.setPreferredSize(new Dimension(100, label.getPreferredSize().height));
panel.add(label);
panel.add(GuiTricks.unboldLabel(new JLabel(value, JLabel.LEFT)));
}
示例4: createConnectionDialog
/**
* Creates the connectionPanel, which will contain all the fields for
* the connection information.
*/
public void createConnectionDialog() {
// Create the labels and text fields.
userNameLabel = new JLabel("User name: ", JLabel.RIGHT);
userNameField = new JTextField("app");
passwordLabel = new JLabel("Password: ", JLabel.RIGHT);
passwordField = new JTextField("app");
serverLabel = new JLabel("Database URL: ", JLabel.RIGHT);
serverField = new JTextField("jdbc:derby://localhost:1527/sample");
driverLabel = new JLabel("Driver: ", JLabel.RIGHT);
driverField = new JTextField("org.apache.derby.jdbc.ClientDriver");
connectionPanel = new JPanel(false);
connectionPanel.setLayout(new BoxLayout(connectionPanel,
BoxLayout.X_AXIS));
JPanel namePanel = new JPanel(false);
namePanel.setLayout(new GridLayout(0, 1));
namePanel.add(userNameLabel);
namePanel.add(passwordLabel);
namePanel.add(serverLabel);
namePanel.add(driverLabel);
JPanel fieldPanel = new JPanel(false);
fieldPanel.setLayout(new GridLayout(0, 1));
fieldPanel.add(userNameField);
fieldPanel.add(passwordField);
fieldPanel.add(serverField);
fieldPanel.add(driverField);
connectionPanel.add(namePanel);
connectionPanel.add(fieldPanel);
}
示例5: buildAddressPanel
private JPanel buildAddressPanel() {
JPanel p = new JPanel();
p.setLayout(new LabeledPairLayout());
JLabel toLabel = new JLabel("To: ", JLabel.RIGHT);
JTextField toField = new JTextField(25);
p.add(toLabel, "label");
p.add(toField, "field");
JLabel subLabel = new JLabel("Subj: ", JLabel.RIGHT);
JTextField subField = new JTextField(25);
p.add(subLabel, "label");
p.add(subField, "field");
JLabel ccLabel = new JLabel("cc: ", JLabel.RIGHT);
JTextField ccField = new JTextField(25);
p.add(ccLabel, "label");
p.add(ccField, "field");
return p;
}