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

The following are Jave code examples for showing how to use setCursor() 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: LafPanel.java   Source Code and License Vote up 5 votes
private JComponent createRestartNotificationDetails() {
    JPanel res = new JPanel( new BorderLayout( 10, 10) );
    res.setOpaque( false );
    JLabel lbl = new JLabel( NbBundle.getMessage( LafPanel.class, "Descr_Restart") ); //NOI18N
    lbl.setCursor( Cursor.getPredefinedCursor( Cursor.HAND_CURSOR ) );
    res.add( lbl, BorderLayout.CENTER );
    final JCheckBox checkEditorColors = new JCheckBox( NbBundle.getMessage( LafPanel.class, "Hint_ChangeEditorColors" ) ); //NOI18N
    if( isChangeEditorColorsPossible() ) {
        checkEditorColors.setSelected( true );
        checkEditorColors.setOpaque( false );
        res.add( checkEditorColors, BorderLayout.SOUTH );
    }
    lbl.addMouseListener( new MouseAdapter() {
        @Override
        public void mouseClicked( MouseEvent e ) {
            if( null != restartNotification ) {
                restartNotification.clear();
                restartNotification = null;
            }
            if( checkEditorColors.isSelected() ) {
                switchEditorColorsProfile();
            }
            LifecycleManager.getDefault().markForRestart();
            LifecycleManager.getDefault().exit();
        }
    });
    return res;
}
 
Example 2
Project: Equella   File: CanvasSettingsPanel.java   Source Code and License Vote up 5 votes
protected void setupGui()
{
	final JLabel canvasUrlLabel = new JLabel(getString("label.canvasurl"));
	final JLabel clientIdLabel = new JLabel(getString("label.clientid"));
	final JLabel secretLabel = new JLabel(getString("label.secret"));
	preamble = new JLabel(getString("preamble", CANVAS_SIGNUP_URL));
	preamble.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
	preamble.addMouseListener(this);

	canvasUrl = new JTextField(20);
	clientId = new JTextField(20);
	secret = new JPasswordField(20);
	bypassLogon = new JCheckBox();
	bypassLogon.setText(getString("label.bypasslogon"));

	final LayoutManager layout = new MigLayout("wrap", "[fill][fill,grow]");
	setLayout(layout);

	setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

	add(preamble, "span 2, gapbottom 20");
	add(canvasUrlLabel);
	add(canvasUrl);
	add(clientIdLabel);
	add(clientId);
	add(secretLabel);
	add(secret);
	add(bypassLogon, "span 2");

	validate();
}
 
Example 3
Project: JWT4B   File: JLabelLink.java   Source Code and License Vote up 5 votes
public void addURL(String content) {
	JLabel label = new JLabel("<html>"+content+"</html>");
	label.setCursor(new Cursor(Cursor.HAND_CURSOR));
	label.setToolTipText(content);
	addMouseHandler(label);
	pan.add(label);
}
 
Example 4
Project: incubator-netbeans   File: StatusLineComponent.java   Source Code and License Vote up 4 votes
private void createLabel() {
    discardLabel();
    label = new JLabel();
    label.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    label.addMouseListener(mouseListener);
}
 
Example 5
Project: incubator-netbeans   File: StatusLineComponent.java   Source Code and License Vote up 4 votes
private void createExtraLabel() {
    discardExtraLabel();
    extraLabel = new JLabel();
    extraLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    extraLabel.addMouseListener(mouseListener);
}
 
Example 6
Project: faitic-checker   File: SubjectsGUI.java   Source Code and License Vote up 4 votes
private static void deselectallsectionbuttons(){
	
	for(Component comp : panelSections.getComponents()){
		
		if(comp instanceof JLabel){
			
			JLabel lblcomp=(JLabel) comp;
			
			lblcomp.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
			lblcomp.setForeground(new Color(0,110,198,255));
			
		}
		
	}
	
}
 
Example 7
Project: faitic-checker   File: SubjectsGUI.java   Source Code and License Vote up 4 votes
private static void selectsectionbutton(Component selcomp){
	
	deselectallsectionbuttons();
	
	for(Component comp : panelSections.getComponents()){
		
		if(comp instanceof JLabel && selcomp.equals(comp)){
			
			JLabel lblcomp=(JLabel) comp;
			
			lblcomp.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
			lblcomp.setForeground(SystemColor.windowText);
			
		}
		
	}
	
	panelOptions.setVisible(selcomp.equals(lblFiles) && online && selectedSubject>=0);
	
}
 
Example 8
Project: Progetto-B   File: LabelMapListener.java   Source Code and License Vote up 2 votes
/**
 * Sets the hand cursor.
 *
 * @param component
 * @param label
 */
private void setHandCursor(Component component, JLabel label) {
    component.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    label.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
}
 
Example 9
Project: Progetto-B   File: LabelMapListener.java   Source Code and License Vote up 2 votes
/**
 * Sets the default cursor.
 *
 * @param component
 * @param label
 */
private void setDefaultCursor(Component component, JLabel label) {
    component.setCursor(Cursor.getDefaultCursor());
    label.setCursor(Cursor.getDefaultCursor());
}