Cursor in Netbeans


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Cursor in Netbeans

  1. #1
    Join Date
    Dec 2004
    Posts
    34

    Cursor in Netbeans

    Sorry if this is not the best place to ask about IDEs, but...
    I'm having a problem regarding Netbeans and a custom cursor.
    When I use Eclipse 3.0, the cursor displays as expected. In Netbeans, however, the same code makes the cursor disappear when it should be set over a component:

    URL imgURL = component.class.getProtectionDomain().getCodeSource().getLocation(); /* Used to check if local directory is the expected one, and indeed it is in both IDEs */
    Toolkit toolkit = Toolkit.getDefaultToolkit();
    ImageIcon iconOpenHand = new ImageIcon("images/openHand.gif");
    Image imageOpenHand = iconOpenHand.getImage();
    Cursor openHand = toolkit.createCustomCursor(imageOpenHand, new Point(15, 15), "openHand");

    If there's a better way to do it, please tell me. Thanks...

  2. #2
    Join Date
    Mar 2005
    Posts
    19
    You shouldn't cheat on your IDE with another IDE, otherwise your just asking for trouble and sooner or later you're going to have to choose one over the other. The longer you leave your decision, the harder it will be

  3. #3
    Join Date
    Dec 2004
    Posts
    34
    I'm not cheating... I use only Eclipse, but my boss wants me to show it in Netbeans, because there's no Eclipse in his network (I don't use Netbeans because it runs too slow in my machine). He thinks it's just too weird it works on one IDE and not on another, after all, both are compiled using J2SE 1.4.2... or is there something else I don't know?

    By the way, why are there such problems between both IDEs? I'm not using any specific resource... so everything was supposed to work in both... If there's a reference to the underlying system, please tell me. If it doesn't work, I have to at least explain my boss why.

  4. #4
    Join Date
    Dec 2004
    Posts
    34
    Updating...
    Today I tried using the prompt java compiler without and IDE.... so I compiled and executed it, and no cursor appeared over the component.
    Then, I added a debug line to print the cursor (using getCursor()), to check if it was null. When I ran it again, the cursor appeared magically! Worse than that, I removed the line and the cursor would still appear... like if the bug had been magically fixed.
    Does anyone know anything like this? If it's a java bug, or a Windows incompatibility issue?...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center