javax.swing.JLabel#RIGHT源码实例Demo

下面列出了javax.swing.JLabel#RIGHT 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: sc2gears   文件: ReplayListColumnSetupDialog.java
public ColumnDef( final int modelIndex ) {
	this.modelIndex = modelIndex;
	positionLabel = new JLabel( "", JLabel.RIGHT );
	positionLabel.setPreferredSize( new Dimension( 40, 0 ) );
	nameLabel     = new JLabel( ReplaySearch.RESULT_HEADER_NAMES[ modelIndex ], JLabel.LEFT );
	GuiUtils.changeFontToBold( nameLabel );
	
	wrapperBox.add( positionLabel );
	wrapperBox.add( Box.createHorizontalStrut( 10 ) );
	wrapperBox.add( Box.createHorizontalGlue() );
	wrapperBox.add( nameLabel );
	wrapperBox.add( Box.createHorizontalStrut( 20 ) );
	wrapperBox.add( moveUpButton );
	wrapperBox.add( moveDownButton );
	wrapperBox.add( Box.createHorizontalStrut( 20 ) );
	wrapperBox.add( visibleCheckBox );
}
 
源代码2 项目: netbeans-mmd-plugin   文件: AbstractPlUmlEditor.java
@Nonnull
protected JLabel makeLinkLabel(@Nonnull final String text, @Nonnull final Runnable onClick,
                               @Nonnull final String toolTip, @Nonnull final Icon icon) {
  final JLabel result = new JLabel(text, icon, JLabel.RIGHT);
  final Font font = result.getFont().deriveFont(Font.BOLD);
  final Map attributes = font.getAttributes();
  attributes.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
  result.setFont(font.deriveFont(attributes));
  result.setForeground(UiUtils.DARK_THEME ? Color.YELLOW : Color.BLUE);
  result.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
  result.setToolTipText(toolTip);
  result.addMouseListener(new MouseAdapter() {
    @Override
    public void mouseClicked(@Nonnull final MouseEvent e) {
      onClick.run();
    }
  });
  result.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 16));
  return result;
}
 
源代码3 项目: dragonwell8_jdk   文件: TableExample.java
/**
 * 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);
}
 
源代码4 项目: jdk8u-dev-jdk   文件: TableExample.java
/**
 * 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 项目: swift-explorer   文件: LabelComponentPanel.java
public LabelComponentPanel(String label, JComponent comp) {
    super(new BorderLayout(8, 0));
    setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
    JLabel lbl = new JLabel(label, JLabel.RIGHT);
    lbl.setLabelFor(comp);
    lbl.setPreferredSize(new Dimension(128, 24));
    this.add(lbl, BorderLayout.WEST);
    this.add(comp, BorderLayout.CENTER);
}
 
源代码6 项目: openjdk-jdk8u-backup   文件: TableExample.java
/**
 * 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);
}
 
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);
}
 
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 identification T address:").getPreferredSize().width + 10;
	tempLabel.setPreferredSize(new Dimension(width, tempLabel.getPreferredSize().height));
	tempPanel.add(tempLabel);
	tempPanel.add(field);
	detailsPanel.add(tempPanel);
}
 
源代码9 项目: hottub   文件: TableExample.java
/**
 * 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);
}
 
源代码10 项目: openjdk-8-source   文件: MetalworksDocumentFrame.java
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;

}
 
源代码11 项目: jdk8u_jdk   文件: MetalworksDocumentFrame.java
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;

}
 
源代码12 项目: mars-sim   文件: ResearcherPanel.java
/**
 * Constructor.
 */
public ResearcherPanel(ScienceWindow scienceWindow) {

	// Use JPanel constructor
	super();

	this.scienceWindow = scienceWindow;

	// Set card layout.
	setLayout(new CardLayout());

	// Create blank panel.
	JPanel blankPane = new JPanel();
	add(blankPane, Msg.getString("ResearcherPanel.blank")); //$NON-NLS-1$

	// Create researcher panel.
	JPanel researcherPane = new JPanel(new BorderLayout());
	researcherPane.setBorder(new MarsPanelBorder());
	add(researcherPane, Msg.getString("ResearcherPanel.researcher")); //$NON-NLS-1$

	// Create the top spring pane
	JPanel topSpringPane = new JPanel(new SpringLayout());// new GridLayout(2, 2, 0, 0));
	researcherPane.add(topSpringPane, BorderLayout.CENTER);

	// Create title label.
	researcherHeader = new JLabel(Msg.getString("ResearcherPanel.primaryResearcher"), JLabel.RIGHT); //$NON-NLS-1$
	topSpringPane.add(researcherHeader);

	// Create name button.
	nameButton = new JButton("[ TBA ]"); //$NON-NLS-1$
	nameButton.addActionListener(new ActionListener() {
		public void actionPerformed(ActionEvent arg0) {
			// Open window for researcher.
			if (researcher != null)
				openResearcherWindow(researcher);
		}
	});
	topSpringPane.add(nameButton);

	// Create science label.
	JLabel scienceHeader = new JLabel(Msg.getString("ResearcherPanel.subjectHeader"), JLabel.RIGHT); //$NON-NLS-1$
	topSpringPane.add(scienceHeader);

	scienceLabel = new JLabel("[ TBA ]"); //$NON-NLS-1$
	topSpringPane.add(scienceLabel);

	// Create activity label.
	JLabel activityHeader = new JLabel(Msg.getString("ResearcherPanel.phaseHeader"), JLabel.RIGHT); //$NON-NLS-1$
	topSpringPane.add(activityHeader);// , BorderLayout.WEST);

	activityLabel = new JLabel("[ TBA ]"); //$NON-NLS-1$
	topSpringPane.add(activityLabel);// , BorderLayout.WEST);

	// Create activity bar panel.
	activityBarPane = new JPanel(new CardLayout());
	researcherPane.add(activityBarPane, BorderLayout.SOUTH);

	// Create blank activity bar panel.
	JPanel blankActivityBarPane = new JPanel();
	activityBarPane.add(blankActivityBarPane, Msg.getString("ResearcherPanel.blankActivityBar")); //$NON-NLS-1$

	// Create activity progress bar.
	activityBar = new JProgressBar(0, 100);
	activityBar.setStringPainted(true);
	activityBarPane.add(activityBar, Msg.getString("ResearcherPanel.showActivityBar")); //$NON-NLS-1$

	// Prepare SpringLayout
	SpringUtilities.makeCompactGrid(topSpringPane, 3, 2, // rows, cols
			5, 4, // initX, initY
			30, 3); // xPad, yPad
}
 
源代码13 项目: TencentKona-8   文件: MetalworksDocumentFrame.java
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;

}
 
源代码14 项目: mars-sim   文件: TabPanelSponsorship.java
public void initializeUI() {
		uiDone = true;
		
		// Create general label panel.
		JPanel labelPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
		topContentPanel.add(labelPanel);

		// Prepare general label
		JLabel titleLabel = new JLabel(Msg.getString("TabPanelSponsorship.label"), JLabel.CENTER); //$NON-NLS-1$
		titleLabel.setFont(new Font("Serif", Font.BOLD, 16));
		labelPanel.add(titleLabel);

		// Prepare spring layout info panel.
		JPanel infoPanel = new JPanel(new SpringLayout());//GridLayout(2, 2, 0, 0));
//		infoPanel.setBorder(new MarsPanelBorder());
		centerContentPanel.add(infoPanel, BorderLayout.NORTH);

		// Prepare sponsor name label
		JLabel sponsorNameLabel = new JLabel(Msg.getString("TabPanelSponsorship.sponsor"), JLabel.RIGHT); //$NON-NLS-1$
		//sponsorNameLabel.setSize(2, 2);
		infoPanel.add(sponsorNameLabel);

		// Prepare sponsor label
		JTextField sponsorTF = new JTextField();
		ReportingAuthorityType sponsor = null;
		if (person.getReportingAuthority() != null) {
		    sponsor = person.getReportingAuthority().getOrg();
		    sponsorTF.setText(sponsor+""); // Conversion.capitalize(sponsor)
		}
		sponsorTF.setEditable(false);
		sponsorTF.setColumns(8);
		sponsorTF.setCaretPosition(0);
		if (person.getReportingAuthority() != null) {
			TooltipManager.setTooltip (sponsorTF, person.getReportingAuthority().getToolTipStr(), TooltipWay.down);
		}
		infoPanel.add(sponsorTF);


		// Prepare birth location name label
		JLabel objectiveNameLabel = new JLabel(Msg.getString("TabPanelSponsorship.objective"), JLabel.RIGHT); //$NON-NLS-1$
		//objectiveNameLabel.setSize(2, 2);
		infoPanel.add(objectiveNameLabel);

		// Prepare birth location label
		String objective = null;
		JTextField objectiveTF = new JTextField();
		if (person.getReportingAuthority() != null) {
			objective = person.getReportingAuthority().getMissionAgenda().getObjectiveName();
		}
		//JLabel objectiveLabel = new JLabel(objective, JLabel.RIGHT);
		objectiveTF.setText(Conversion.capitalize(objective));
		objectiveTF.setEditable(false);
		objectiveTF.setColumns(16);
		objectiveTF.setCaretPosition(0);
		infoPanel.add(objectiveTF);

		//Lay out the spring panel.
		SpringUtilities.makeCompactGrid(infoPanel,
		                                2, 2, //rows, cols
		                                20, 10,        //initX, initY
		                                10, 10);       //xPad, yPad
	}
 
源代码15 项目: hottub   文件: MetalworksDocumentFrame.java
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;

}
 
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;

}
 
源代码17 项目: openjdk-8   文件: MetalworksDocumentFrame.java
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;

}
 
源代码18 项目: jdk8u-dev-jdk   文件: MetalworksDocumentFrame.java
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;

}
 
源代码19 项目: jdk8u-jdk   文件: MetalworksDocumentFrame.java
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;

}
 
源代码20 项目: jdk8u-jdk   文件: MetalworksDocumentFrame.java
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;

}