当前位置: 首页>>代码示例>>Java>>正文


Java JLabel.RIGHT属性代码示例

本文整理汇总了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);
}
 
开发者ID:ZencashOfficial,项目名称:zencash-swing-wallet-ui,代码行数:11,代码来源:MessagingOptionsEditDialog.java

示例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);
}
 
开发者ID:ZencashOfficial,项目名称:zencash-swing-wallet-ui,代码行数:11,代码来源:IdentityInfoDialog.java

示例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)));
}
 
开发者ID:cccssw,项目名称:enigma-vk,代码行数:11,代码来源:Gui.java

示例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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:40,代码来源:TableExample.java

示例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;

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:MetalworksDocumentFrame.java


注:本文中的javax.swing.JLabel.RIGHT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。