Linux - The custom cursor is looking bad

Creating a custom cursor using png 32x32 images. The images are displaying perfect as a cursor on Windows and Mac but, on Linux the image is bad. Below I am pasting code to test the things by using some png image.
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.net.URL;
import javax.swing.*;
public class UserCursor {
     private void initComponents() {
          JFrame jf = new JFrame("Cursor Test");
          jf.setLayout(new BorderLayout());
          final JButton jb = new JButton("Change Cursor");
          jf.getContentPane().add(jb,BorderLayout.NORTH);
          jf.setSize(200, 200);
          jf.setVisible(true);
          final Cursor cur = createCursor();
          jb.addMouseListener(new MouseAdapter(){
               public void mouseEntered(MouseEvent arg0) {
                    jb.setCursor(cur);
     private Cursor createCursor() {
          Cursor userCursor=null;
          Toolkit toolkit = Toolkit.getDefaultToolkit();
          URL icon = getClass().getResource("images/someImage.png");
          Image image = new ImageIcon(icon).getImage();
          userCursor = toolkit.createCustomCursor(image, new Point(0, 0), "My Cursor");
          return userCursor;
     public static void main(String args[])
          UserCursor uc= new UserCursor();
          uc.initComponents();
}

Kanni wrote:
Toolkit.getBestCursorSize(....)
I tried using above suggestion to solve my cursor problem. It didn't work for me.
ThanksSo how did you try this. Did you use the result of this function to choose a suitable cursor glyph? Did you use it to scale the original using an Affine Transformation?
How can anyone give any further help if the only feedback you provide is "it didn't work" .

Similar Messages

  • Custom white balance looks bad/off when set on the 5d Mark iii

    I got my Mark iii in June and every time I set a custom white balance it doesn't look right. I have used both a purchased grey card and a white piece of paper, both look bad. When I set it on my Rebel Xs it looks perfect, no adjustments needed in post processing, but not the case with the Mark iii. Shouldn't it be the other way around, considering the price tag on the iii ?

    Canon "tags" RAW images with meta-data regarding white balance (and other info) but does not actually alter the image. Depending on what you use to process the images on the computer, it can read those tags and decide to apply it's interpretation. But those white balance adjustments would be applied by your computer software (assuming they are being applied -- not all software does this) -- and not by the camera.
    I use Aperture (Apple's pro photography software), which has a camera profile for each camera. The profiles can compensate if, for example, one camera is naturally "cooler" than another.
    Tim Campbell
    5D II, 5D III, 60Da

  • Is the customer service really that bad? (possible future customer)

    I'm currently with Brighthouse and I'm looking to switch to a bundle of cable/internet/phone.  Not just here but all across the internet I've read about Verizon's horrible and unprofessional customer service.  Is it bad enough where I should reconsider switching over?  I have Verizon Wireless for my cell phone and haven't had too many issues with them.  If the CS is that bad, does the equipment and internet speed make up for it?
    If it is that bad I would appreciate someone letting me know and saving me the money and hassle.
    Thanks for your help.
    Solved!
    Go to Solution.

    only when you need to talk to someone. 

  • Can the Add To Cart image render the hand cursor to look more like a clickable link?

    I have used a custom image for the add to cart tag - {tag_addtocart,<img src="/images/fg_buttonbuy.jpg" width="203" height="76" />} - however our client is worried people will be unsure if that's where they click to add the product to the cart as the cursor stays as the arrow and doesn't change to the hand like when clicking on other links.
    I was pointed to this page http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_button_test and told I was able to customise my code so that it did render the hand. I've done a little bit of trial and error however am unsure how to add the button code to the add to cart tag.
    If anyone is able to assist it would be greatly appreciated!

    I tried the target the class but there was no class associated with the button rendered:
    <img src="/images/button.gif" alt="" onclick="AddToCart(83934,3349995,'',3,'','',false);return false;">
    Can I wrap it in <span class="button"><img . . .></span>? If so does it need to be assigned to the link. ie. .button img a { cursor:pointer; }
    Thanks.

  • Custom Chrome and Custom Cursor problems

    Howdy, I've got a small problem with chrome and cursors.
    I've created my main application window with the chrome set to Custom-Opaque
    I've got my custom frame, window controls etc. all wired up and working nicely.
    I've got my cursor manager swithing the cursor to resize-arrows when you get close to the window edges.
    Here's where I run into a couple problems:
    The cursor is only visible within the bounds of the window--unlike the system chrome which gives the resize cursors outside the window bounds. Any way to use the system cursors? or another idea?
    When I resize the window, the custom cursor stays right where the MOUSE_DOWN event occured, and doesn't move with the mouse anymore. The window does resize though... Any suggestions?
    Thanks in advance!
    -Ted

    I have the same problem but I extend the WindowsLookAndFeel. I know of a way to fix this but it seems unbelievable that this is the only way. Here is how I did it: In your custom look and feel class add this method. Call the super version and then add the icons that are missing to the UIDefaults table. Of course your code would have MetalLookAndFeel where my example has WindowsLookAndFeel. Hopefully someone will come up with a better solution. I plan on raising a bug in the bug parade for this.
    protected void initComponentDefaults(UIDefaults table)
              super.initComponentDefaults(table);
              table.put("DesktopIcon.icon", LookAndFeel.makeIcon(WindowsLookAndFeel.class,"icons/DesktopIcon.gif"));
              table.put("Tree.openIcon",LookAndFeel.makeIcon(WindowsLookAndFeel.class,"icons/TreeOpen.gif"));
              table.put("Tree.closedIcon",LookAndFeel.makeIcon(WindowsLookAndFeel.class, "icons/TreeClosed.gif"));
              table.put("OptionPane.errorIcon", LookAndFeel.makeIcon(WindowsLookAndFeel.class,"icons/Error.gif"));
              table.put("OptionPane.informationIcon", LookAndFeel.makeIcon(WindowsLookAndFeel.class,"icons/Inform.gif"));
              table.put("OptionPane.warningIcon", LookAndFeel.makeIcon(WindowsLookAndFeel.class,"icons/Warn.gif"));
              table.put("OptionPane.questionIcon", LookAndFeel.makeIcon(WindowsLookAndFeel.class,"icons/Question.gif"));
              table.put("Tree.leafIcon", LookAndFeel.makeIcon(WindowsLookAndFeel.class,"icons/TreeLeaf.gif"));
    Hope this helps.

  • Custom cursor is too slow in FULL_SCREEN_INTERACTIVE

    My custom cursor is fast in window mode (even maximized) but not in fullscreen where it is really slow.
    Is there a solution to this?

    Dear Rob,
    Thanks for your answer.
    I have put together a simple test case (see attached zip file) and the custom cursor is still "too slow to be usable" in fullscreen mode. Run it and see that the cursor is fast in window mode. Then hit ctrl+enter to go into fullscreen and see how slow the cursor becomes.
    Code:
    package
    import flash.events.MouseEvent;
    import flash.events.KeyboardEvent;
    import flash.ui.Mouse;
    import flash.ui.Keyboard;
    import flash.display.StageDisplayState;
    import flash.display.MovieClip;
    public class Main extends MovieClip
    private var _mousePointer:MousePointer;
    public function Main()
    super();
    Mouse.hide();
    _mousePointer = new MousePointer();
    addChild(_mousePointer);
    stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyboardDown);
    stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMoved);
    private function goFullscreen(fullscreen:Boolean)
    if(fullscreen)
    stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
    else
    stage.displayState = StageDisplayState.NORMAL;
    private function onMouseMoved(evt:MouseEvent)
    _mousePointer.x = mouseX;
    _mousePointer.y = mouseY;
    evt.updateAfterEvent();
    private function onKeyboardDown(evt:KeyboardEvent)
    if(evt.controlKey && evt.keyCode == Keyboard.ENTER)
    goFullscreen(stage.displayState == StageDisplayState.NORMAL);

  • 16.0.3: custom cursor for third party plugin missing

    We are using a third party plugin which has its own cursor (probably 16x16 png), and after upgrade to AI 16.0.3 on Mac OS 10.8, iMac, the custom cursor just gone, currently it ues system cursor (a black arrow).
    Any detailed info about this upgrade may cause the problem?

    So, here's what happened. In the 16.0.3/16.2 update, Adobe broke sAIUser->SetCursor(). Any plug-in that was using this call to display cursors will no longer be able to change their cursors on Mac. Cursors did not break on Windows. There are two options for developers; either change to platform cursors or wait for Adobe to issue a fix (I do not know, however, if one is planned). Hot Door has already changed to platform cursors and will be issuing an update later this week. There is a discussion on StackOverflow for those interested in the programming solution.

  • Custom cursor click

    I'm using this to create a custom cursor and to use a mouse click event on a movieclip:
    stop();
    Mouse.hide();
    stage.addEventListener(MouseEvent.MOUSE_MOVE,follow);
    function follow(evt:MouseEvent)
              cursor_mc.x = mouseX;
              cursor_mc.y = mouseY;
    volgendePijlClip.addEventListener(MouseEvent.CLICK, pijlEventClip);
    function pijlEventClip(event:MouseEvent):void
              trace(1)
    At first it didn't work for me, but I found out that was because the custom cursor was over its registration point. Which was made equal to the mouse's location. So when the mouse was clicked on the movieclip-button, it was actually clicking on the custom mouse cursor itself, so the click on the 'volgendePijlClip movieclip wasn't picked up on.
    I solved it by moving the custom cursor slightly away from it's registration point, so it would appear slightly of mouseX/mouseY. Close enough to act as cursor, but away of the cursor enough so the hidden mouse cursor could pick up a click on 'volgendePijlClip'.
    Was wondering if there still was a way for a custom cursor to be over it's registration point and have the hidden mouse cursor still pick up on clicking on objects beneath the custom cursor?

    assign its mouseEnabled property to false:
    cursor_mc.mouseEnabled=false;

  • How would I create a layer ABOVE a custom cursor? [CS5 Pro]

    ...so the custom cursor would disappear behind the layer when moved across it.
    Currently if the layer is simply put at the top of the layer list [above the mouse cursor layer] when published the mouse cursor supersedes it and appears above all layers... not behind any
    Many many thanks for your help in advance oh Holy Whizzkids

    First, try removing that first line and see if it helps.
    Second, if it doesn't help, after that line do the same for whatever object you have in the layer you want to sit above the cursor... it'll need to be objects that you can target with code.
    What addChild() does is it takes the object being targeted and places at the top of the display list.  So that first line is essentially uprooting whytehand from the timeline and placing it above all other content planted in the timeline.  So either you don't use it, or you also use it to place the other content above the cursor.

  • CS3 Custom cursor acting wierd

    Hello, I am a student in an animation class; our current project is making a website portfolio.  I have discovered some sort of bug or something to that effect, inside of my custom cursor is a button, this button contains a click function.  When I click with the cursor the animation does play, but to a point.  The error occurs when the layer with the custom cursor is above the layer with the buttons.  Neither the rollover, nor the "go to" function work when the timeline's layers is arranged like so.  BUT when the custom cursor is in a layer below the buttons the buttons work fine, but the cursor's animation doesn't play when you click on them, and becaue the cursor is on a layer below the buttons it appears below the buttons when rendered out.
    Please help if you can,
    Thanks!~

    that's normal behavior.  mouse events are intercepted by the top-most interactive object.
    if you want help working-around that behavior, are you using as2 or as3?

  • Custom cursor

    I thought this was simple. I need some custom cursors.
    Created the cursor as a movieclip object on a new layer's first
    frame and on its actions I have
    onCLipEvent(load) {
    this.startDrag();
    when the movie loads, the custom cursor moves alright except
    its some distance from the standard cursor so its of course not
    working as expected and if I hide the cursor it will be unusable.
    Tried setting the movieclips _x to mouse x and that did not help
    either. What amd I missing?

    jgn2006 wrote:
    > Thanks Erick and kglad for your quick responses. Erick
    your suggestion seems
    > to work very well. Better than using a mouse listener. I
    had tried adding
    > that to a mouse listener and there seems to be a split
    second of delay between
    > mouse movement and my custom cursor.
    Peter already said.. using the global function
    updateAfterEvent he will
    work like you wants. The problem is caused by FPS, the
    updateAfterEvent
    function updates the coordinates of the mc independently of
    FPS.
    //Mouse.hide();
    mcCursor.onMouseMove = function():Void{
    this._x = _xmouse;
    this._y = _ymouse;
    updateAfterEvent();
    Regards,
    Erick Souza
    www.ericksouza.com

  • Custom Cursor and Components

    Hey guys,
    My flash project uses a custom cursor which works fine and is above all my other flash elements. However when I use components such as a combo box, the combo box drop down list is in front of my custom cursor so that the user cannot see the custom cursor when interacting with these kinds of components.  Can anything be done to ensure that my custom cursor graphic stays on top of even the native flash components?
    Thanks

    use the swapDepths() method of movieclips to adjust the
    apparent depth of you cursor. (you can use the getDepth() method of
    movieclips to find the depth of your combobox.):

  • How can I use a SCH-LC11 device in CHINA which bought from ebay. I am not Verizon customer but I prefer to using your 4G LTE Router . How can I get the unlock code? The device may have a bad ESN but I only use it in CHINA. Kindly looking forward your repl

    How can I use a SCH-LC11 device in CHINA which bought from ebay. I am not Verizon customer but I prefer to using your 4G LTE Router . How can I get the unlock code? The device may have a bad ESN but I only use it in CHINA. Kindly looking forward your reply. Thanks!

    It's good to read Antoniad's post.  It reassures me that I can use my new iPad as an international communication device which is the reason I purchased the thing.  However, I called Verizon today (my provider of cellular data) who told me that I can't just pop in a SIM card as you suggested.  He also said that he was from the "Pre-Pay" division of Verizon and he was certain that I couldn't do what I planned to do.  I was extremely disappointed as I had called Apple prior to buying the iPad and I read the algorhythm on the website for choosing an iPad before purchasing.  Those sources were quite specific and the information seemed clear.  I would be able to use my iPad to communicate through cellular connections while traveling on the road, literally, abroad.  I was told that I could pop in a data card wherever I was, just as you indicated in your message above, and voila I was good to go.  The Verizon rep definitively rained on that parade, but said that I might be able to do this if I have a "Post-Pay" account, a different area of Verizon.  I haven't had the chance to talk to this division yet, so I looked to Apple's Support for answers.  Maybe I will find out that I can use my iPad as an international communication device while traveling on the road afterall, however, it appears I may need a different type of account (Post-Pay), something I was never warned about. Can I switch to this kind of account?  I don't know.  I have to find out.  If you have any information about this issue, it would be good to share since I strongly suspect there are others who bought the iPad for the same purpose that I have.

  • Add custom fields to the business partner (UKM_BP) thru BADI

    Hi
    I want to know how to add Additional business partner attributes(custom fields) to Business partner (Transaction : UKM_BP)
    I also added the custom fields to structure UKM_S_BP_CUSTOMER_EXTENSION in the method FILL_FIELDS of BADI UKM_BP_ADD_FIELDS, But nothign is populating on the screen of UKM_BP after activating the below BADI's with SAP provided sample code with above structure.
    there are 2 BADI's for this requirements but it doesn't any thing about the screens
    UKM_BP_ADD_FIELDS
    UKM_EV_FORMULA
    Please let me know the detailed steps other than activating these BADI's with sample code by SAP.
    Thanks
    Govi

    Thanks for your reply
    BADI - UKM_BP_ADD_FIELDS
    Documentation of this BADI shows as follows...
    With this BAdI, you can define additional business partner attributes that you define in a business partner master record and want to use as fields in the formula editor.
    To use the new fields, implement the BAdI: Formula Parameters and Functions (UKM_EV_FORMULA)
    Methods of this BAdI:
    FILL_FIELDS
    To provide additional fields for the formula editor
    FILL_ADD_INFOS and SAVE_ADD_INFOS
    To define additional information for the following data in table form:
    Collateral
    Negative event
    Check exceptions
    Credit insurance
    I enhanced the structure(UKM_S_BP_CUSTOMER_EXTENSION) with new custom fields from the badi UKM_BP_ADD_FIELDS but there is documentation for creating the new screen to place those new fileds i created on transaction UKM_BP.
    I have looked at BDT Business data toolset
    http://help.sap.com/saphelp_crm50/helpdata/en/2f/696d360856e808e10000009b38f839/frameset.htm
    but i didn't get any idea ...
    Can you please elaborate and let me know how to do this for my requirement?
    Thanks
    Govi

  • Subject : Slideshow looks bad  Hello guys  I have a project in my Final Cut just about done.  I want to add my slideshow as part of the project and burn it to DVD.  In my slideshow, there are some stills from the movie clips and some downloaded from the i

    Subject : Slideshow looks bad
    Hello guys
    I have a project in my Final Cut just about done.  I want to add my slideshow as part ofthe project and burn it to DVD.  Inmy slideshow, there are some stills from the movie clips and some downloadedfrom the internet but they all look blur when playback and even worse if Iapply Ken Burn to it.   Pleasesome one can tell my how to do it right or it can’t be done because thedownload quality and stills from the clip are not suitable or slideshow.  Thank you
    PSC

    Thank you Ross.
    The entire DVD containing Quick Time movies (Final CutExpress project) and slideshow was done in iPhoto.  The Final Cut project was rendered prior to export to QT,  the slideshow was sent to iDVD withoutrendering. The slideshow with most of the pictures from my still camera incombination with stills from movie clips and some downloaded from the Internet.After burning, the movie playback is perfect but the slideshow is not.  The slideshow containing 3 differentkinds of pictures; those from my still camera looks OK; the stills from themovie clips and from the Internet are not.  I don’t have much knowledge in this game, but I think NTSCwith frame size 720x480, and the downloaded picture Item Property shows most ofthem are between 400 to 500 x 300 to 600, may be both of them are not suitablefor TV screen while the stills from my still camera looks OK because they are2048x1536.  Please enlightenme.  Once again, thank you so much,I really appreciate the time you offered.
    psc

Maybe you are looking for

  • FM SPE_CALCULATE_PRICE - Java Call does not return Net Value of Sales Order

    Dear Experts, we want to make a call of FM SPE_CALCULATE_PRICE from the SAP NetWeaver Developer Studio to achieve that we receive the Net Value of a Sales Order. When we try to test the Scenario in SAP CRM (Creation of a Sales Order) Itself all is wo

  • Sending Mail is sporadic

    Mail has suddenly had decided to fail to send after a brief lapse of activity. After two tries of editing mail, it will eventully send. I've seen this before on early OS systems, but can't recall the fix accept to update to the next OS. I'm at 10.4.6

  • Is OS X Lion compatible with iMac?

    I just installed OS X Lion on my MacBook Pro. Can I also install this softeware update on iMac (latest version is 10.6.8)?

  • Can't get Airport Express back onto my wireless network???

    Just returned from a trip where I had successfully used my AE in temp accommodation. Now I can't get the thing to rejoin my home network. I've reset it time after time, I go through Airport Setup Asst and get to the bit where it says it's updating th

  • GPS Coverage

    Hey everyone.  I'm currently waiting for my Droid Incredible to arrive at my house and this will be my first smartphone so I need some feedback on the GPS in a certain situation I will be having in the next week. So my question is, will the GPS on th