當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。