本文整理汇总了Java中javax.swing.JLabel.setCursor方法的典型用法代码示例。如果您正苦于以下问题:Java JLabel.setCursor方法的具体用法?Java JLabel.setCursor怎么用?Java JLabel.setCursor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JLabel
的用法示例。
在下文中一共展示了JLabel.setCursor方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRestartNotificationDetails
import javax.swing.JLabel; //导入方法依赖的package包/类
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;
}
示例2: setupGui
import javax.swing.JLabel; //导入方法依赖的package包/类
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();
}
示例3: addURL
import javax.swing.JLabel; //导入方法依赖的package包/类
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);
}
示例4: createLabel
import javax.swing.JLabel; //导入方法依赖的package包/类
private void createLabel() {
discardLabel();
label = new JLabel();
label.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
label.addMouseListener(mouseListener);
}
示例5: createExtraLabel
import javax.swing.JLabel; //导入方法依赖的package包/类
private void createExtraLabel() {
discardExtraLabel();
extraLabel = new JLabel();
extraLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
extraLabel.addMouseListener(mouseListener);
}
示例6: deselectallsectionbuttons
import javax.swing.JLabel; //导入方法依赖的package包/类
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));
}
}
}
示例7: selectsectionbutton
import javax.swing.JLabel; //导入方法依赖的package包/类
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);
}
示例8: setHandCursor
import javax.swing.JLabel; //导入方法依赖的package包/类
/**
* 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));
}
示例9: setDefaultCursor
import javax.swing.JLabel; //导入方法依赖的package包/类
/**
* Sets the default cursor.
*
* @param component
* @param label
*/
private void setDefaultCursor(Component component, JLabel label) {
component.setCursor(Cursor.getDefaultCursor());
label.setCursor(Cursor.getDefaultCursor());
}