Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 75805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:34:25+00:00 2026-05-10T20:34:25+00:00

I have a Java Swing application, developed on Mac OS X 10.5 using Java

  • 0

I have a Java Swing application, developed on Mac OS X 10.5 using Java 1.5.

I’m trying to make a custom cursor appear when the user moves the mouse over some text in a dialog. The cursor never changes, though.

When I don’t use a JFrame instead of a JDialog, the cursor does change. But then I’ll have to write all the dialog code myself.

How can I get the cursor to appear?

Here’s the simplest code I could create to demonstrate the problem:

import javax.swing.*; import java.awt.*;  public class CursorTest {      public static void main(String[] args) {         JLabel label = new JLabel('Move mouse here for hand cursor');         label.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));         JOptionPane pane = new JOptionPane(label);         pane.setOptions(new Object[]{'OK'});          JDialog dialog = pane.createDialog(null, 'Test Dialog');         dialog.setVisible(true);     } } 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T20:34:26+00:00Added an answer on May 10, 2026 at 8:34 pm

    Looks like it is a bug in Java 1.5: I first tried with Java 1.6.0_07 and it worked as expected (on Windows XP). Then I recompiled with Java 1.5.0_06 and indeed the cursor remains in default state.

    Knowing the difficulties of Java 1.6 on MacOS, I see it will be hard to fix that…

    Bug ID: 5079694 JDialog doesn’t respect setCursor
    They give a workaround…

    [EDIT] Tested workaround:

    public class CursorTest extends JFrame {   private CursorTest()   {   }    private void ShowDialog()   {         JLabel label = new JLabel("Move mouse here for hand cursor");         label.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));         JOptionPane pane = new JOptionPane(label);         pane.setOptions(new Object[] { "OK" } );          JDialog dialog = pane.createDialog(this, "Test Dialog");         dialog.setVisible(true);   }    public static void main(String[] args)   {     SwingUtilities.invokeLater(new Runnable()     {       public void run()       {         CursorTest testFrame = new CursorTest();         testFrame.setTitle("Test GUI");         testFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);         testFrame.setSize(500, 300);         testFrame.setVisible(true);         testFrame.ShowDialog();       }     });   } } 

    Works fine with my JDK & system.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 95k
  • Answers 95k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The way to authenticate depends completely on the authentication method… May 11, 2026 at 7:00 pm
  • Editorial Team
    Editorial Team added an answer We had a very similar problem, which was fixed by… May 11, 2026 at 7:00 pm
  • Editorial Team
    Editorial Team added an answer If you use MySQL 6, you're fine -- see http://dev.mysql.com/doc/refman/6.0/en/backup-database-restore.html… May 11, 2026 at 7:00 pm

Related Questions

I have developed a Java swing application, then I have deployed it through a
Some users of our Swing application have reported weird artefacts appearing on the display.
I'm part of a team that develops a pretty big Swing Java Applet. Most
Do I really have to learn Objective-C to develop solid Mac Apps? As Mac

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.