Java Code Examples for javax.swing.JLabel.setName()

The following are Jave code examples for showing how to use setName() of the javax.swing.JLabel class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: incubator-netbeans   File: ToolbarRow.java   Source Code and License Vote up 6 votes
/**
 * Adds a fake component and appropriate constraints that will be used to
 * visualize toolbar drop feedback.
 */
private void addDropConstraints() {
    dropConstraints = new ToolbarConstraints(FAKE_NAME, ToolbarConstraints.Align.left, false, true);
    dropReplacement = new JLabel();
    dropReplacement.setName(dropConstraints.getName());
    add( dropReplacement );
    constraints.add( dropConstraints );
}
 
Example 2
Project: AgentWorkbench   File: GraphEnvironmentPopupPlugin.java   Source Code and License Vote up 6 votes
/**
 * Returns a JMenueItem for the properties of a NetworkComponent.
 *
 * @param networkComponent the NetworkComponent
 * @return the JMenueItem for the specified NetworkComponent
 */
private JLabel getJLabel4NetworkComponent(NetworkComponent networkComponent) {
	JLabel jlabel = new JLabel();
	jlabel.setName(MENU_ITEM_NAME_PREFIX + "_JLabel_" + networkComponent.getId());
	jlabel.setFont(new Font("Dialog", Font.BOLD, 12));
	jlabel.setText("       " + networkComponent.getType() + ": " + networkComponent.getId());
	return jlabel;
}
 
Example 3
Project: sumo   File: SumoPlatform.java   Source Code and License Vote up 6 votes
/**
 * At startup create and show the main frame of the application.
 */
@Override
protected void startup() {
    try {
    	plManager=new PluginsManager();
    	JLabel label = new JLabel();
        label.setName("SUMO_1.3.4");
        show(new GeoImageViewerView(this));
    } catch (Throwable ex) {
    	logger.error(ex.getMessage(), ex);
    }
}