JTree icons getting cropped

Hi,
I have a JTree in which I show the local file system.
I set the cell renederer to this:
private class SourceTreeCellRenderer extends DefaultTreeCellRenderer
               public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel,
                    boolean expanded, boolean leaf, int row, boolean hasFocus)
                    super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
                    setIcon(FileSystemView.getFileSystemView().getSystemIcon(((TreeFile)((DefaultMutableTreeNode)value).getUserObject()).getFile()));
                    return this;
And I can see the normal windows icons (folder, word file etc).
It works OK but some of the icons do not show fully , they are cropped or cut-off at the bottom.
I've tried lots of different things like tree.setRowHeight() and setting the size of the DefaultTreeCellRenderer but nothing works.
Any Ideas?
Thanks,
Jim

Thanks for your reply Denis.
I've just found out that my app works fine when I have my DPI setting set to Normal size (96 DPI).
(I can alter this setting via Control Panel/display/settings/advanced/general.)
But if the DPI is set to 120 I get the problem.
I need the app to be able to work properly for both DPI settings.
Could you maybe change your DPI to 120 and try your app to see if you get the same problem ?
Anyway, Thanks again,
Jim

Similar Messages

  • When i send a PDF via e-print, it gets cropped, is there a way to prevent this from happening?

    PDF's are printing fine when i print direct to the printer but when they are sent by e-mail they get cropped, is there a way to get the document to fit to page when sent as an email attachment?
    The Printer in question is a HP LaserJet Enterprise 500 color M551n, the printer is brand new installed last week so i don't know if this is the norm or not.
    Edit: Please can someone please explain how to correct this.

    If you're using a desktop or notebook PC to send the email you could try installing the HP ePrint Mobile Driver software on your machine, the link to the download is here. This will allow you to print the PDF to any ePrint capable printer without having to email it to the printers email address as an attachment.
    Once installed and with your PDF open on your machine, select Print from the File menu, then select "ePrint" from the list of available printers (don't select the actual printer itself) and click Print in the bottom right corner of the box. A dialogue box will open showing the avaialble ePrint printers you can print to. Click on the Connected button on the left of the screen to add your printer to the list if its not listed.  
    Hope this helps.
    If my reply helped you, feel free to click on the Kudos button (hover over the "thumbs up").
    If my reply solved your problem please click on the Accepted Solution button so other Forum users may benefit from viewing the post.
    I am an HP employee.

  • I have a new I phone 5c and every few days the screen icons get bigger , almost like the don't fit the screen anymore. I have to shut phone down , why is this

    I have a new I phone 5c and every few days the screen icons get bigger , almost like the don't fit the screen anymore. I have to shut phone down , why is this

    probably your zoom is on. try double tapping with three fingers on your screen, it should go back to normal and then goto
    settings>general>accesibility>zoom and disable it

  • Movie gets cropped on HDTVs

    I have created a movie in Final Cut Pro X and then burned a DVD disk in iDVD. The movie shows the whole 16:9 frame on the computer and a CRT TV. The movie gets cropped on the two HDTVs I have tested it on. The DVD players have be set to their default seetings. When I place a DVD such as one from Netflix nothings gets cropped, so I am at a loss as to what is happening to my DVD
    The two HDTVs I have tested on cropped the movie differntly. On one just the left and right side are cropped, not the top and bottom. On the other tv the cropping is equal on all sides.
    The size of the movie is 1920 x 1080. Video Mode = NTSC. Aspect Ration = 16:9. Encoding = Proffessional Quality. Movie length = 17 minutes
    Thanks in advance - Sam

    After posting the above I saw in "More Like This" a possible solution in myDVDEdit. So I am going to check it out and see if it can solve this problem.
    The people who work on iDVD should be aware of this issue and fix it.

  • My home screen icons get misaligned when i switch apps by double tapping the home button. Using iPad Air, My home screen icons get misaligned when i switch apps by double tapping the home button. Using iPad Air

    My home screen icon get misligned when I switch between apps. also subway surfer behave strangley as in there is a graphical glitch

    I have no idea what Subway Surfer should look like so I wouldn't know if there was a graphical glitch in your screenshot or not, but I assume that the brown figure on the left side should, have real definition in the features and details in the clothing rather than just look like a smeary brown blob. That's just a guess on my part.
    I understand that you paid good money for the device and that it should not be doing what you are experiencing. I would start with the basic troubleshooting steps - moving all the way up to a complete restore of the iOS - and if they don't work, then you will have to contact Apple if you want resolution to the problem. They must have an authorized repair facility that you could send the device to if needed.
    Restart, reset, restore.

  • How does the icon get created for a saved file

    In my program I allow saving files using JFileChooser and ActionListener.
    In the constructor of the main class which extends JFrame I also set an icon by saying:
    this.setIconImage(new ImageIcon("image.jpg").getImage());
    This does not only set an icon on the title bar and the minimized window, it also creates an icon on my saved files. However, the image quality for the icon on my saved files is bad, even though the image quality for the other icons is ok. The size of the icon image I am providing is close to the size of the icon image on my saved files.
    How did the icon get created for my saved files? Is it possible to improve the image quality?
    Thanks for looking at this!

    I just realized that
    this.setIconImage(new ImageIcon("image.jpg").getImage())
    did not create the icon for my saved files.
    So what did create it? I did not program it!
    However, I happen to have an icon file Ananya.ico where I have my java project. I use if for my installation file. Did Java use this icon?
    Please help! Thanks!

  • Still shots are getting cropped on playback in Premiere or export

    Not sure why, but when I import a bunch of png images they are getting cropped whey I try to play them or export them to a movie.  Any ideas why?

    Welcome to the forums.
    See: FAQ:How do I automatically scale clips to the Project Size?
    Cheers
    Eddie

  • How to Create Icon Get Adobe Reader

    How to create Icon "get Adobe reader" at my free website [link removed] for visitor downloading the price list brochure with adobe.
    Please help.
    Thanks

    You don't need to create an icon, you can get it and linking instructions at http://www.adobe.com/misc/linking.html#linking

  • Vob videos get cropped in Premiere Pro CC upon importing

    At importing Vob videos (format 720 x 576) they get cropped to 520 x 576.
    I tried with various videos and it happened with all of them.
    This seems to be a premiere pro CC bug as it doesn't happen in Premiere Pro CS6, where they import fine.

    Thanks for your answer John.
    I read the link you posted and I have also posted a bug report.
    The cropping happens at the importing, not at the sequence editing or exporting. It is the source video that is cropped when imported.
    Although they talk about other video formats this seems to have happened to other customers:
    http://forums.adobe.com/message/5659250#5659250
    Again, thanks for your answer.

  • Icons get all jumbled up on desktop when...

    What's with Mountain Lion?  Never was an issue in Snow Leopard.
    My icons get all jumbled up into one little corner, piled on top of eachother when I am in sleep mode. 
    This happens when I decide to plug in my external monitor (DELL ST241) while it is in sleep mode, then come out of sleep mode by moving my mouse or hitting a key.  Everything else is ok and looks great.  It worked ok for awhile but the last 2 times this seems to happen! 
    I did a disk utility to repair permissions just in case that was the problem and it appears not.  Hardly anything to repair, for that matter.  When I open my laptop, the icons are the same and I have to re-arrange them. 
    Can I fix this problem?

    Don't know what happened to my pic of my icons... anyways, does anyone have some thoughts about this?

  • When I use the mirror display on my macbook my icons get all messed up when I unplug it.  How do I fix this?

    When I use the mirror display on my macbook my icons get all messed up when I unplug it.  How do I fix this?

    What level of OS X is installed on your Mac (your profile is incomplete)?
    Barry

  • Picture used in Chapter portion of Theme getting cropped

    I am using one of the themes in iMovie. When I go to put a picture in the Chapter portion of the theme, the top portion of the picture is getting cropped off. This picture was taken vertically. A picture taken horizontally fits fine. If I try and constrain the size using iPhoto, the picture just gets larger and the heads of the people are still missing. How can I photos taken vertically to fit in the chapter theme without being cropped?

    Welcome to the discussion!
    iMovie lets us drag the image in the Drop Zone to move it left/right or up/down, depending on the Theme. (Place the mouse over the image in the Drop Zone and press the Option key. Drag the image.)
    Karl

  • Fast moving objects get "cropped"

    I have got this annoying problem with Flash. Whenever I tween an object fast across the screen the part which points to the direction of the movement of the object gets cropped.
    Here is an example:
    The circle is moving across the screen roughly 3 times every second and as you can see, the front has magically disappeared for some reason. Same thing happens for objects moving slower aswell but the cropped off part is smaller. I could not printscreen this as the screen pauses on the current frame when you do that so that is why I used an external camera. Updating my graphic card drivers has not solved the problem.
    Has anyone else ever had this problem?
    Any help is appreciated.

    the only other options for you are:
    1.  optimize the performance of your swf, in general.  (a complex topic for advanced developers.)  but the simplest performance enhancement would be to enable the cacheAsBitmap properties of all other objects that would benefit.
    2.  upgrade your computer's graphics capabilities.
    3.  ignore the problem if it only occurs on computers that have such limited capabilites that it's not likely to impact many users.

  • W700 desktop icons get rearranged every time I boot up

    I read in this forum about a similar problem some people were having on theThinkpad W500 laptop running XP where their icons got messed up when they closed the lid.  My problem is that my icons get messed up every time I turn the laptop on, and I'm running Win7.  I have no idea what setting needs to be changed to prevent this.  Does someone have the solution?

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, or by corruption of certain system caches. 
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled on some models, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including sound output and  Wi-Fi on certain iMacs. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. Test while in safe mode. Same problem? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • Getting Rid of a JTree icon

    Hi !,
    I was trying to customize the example of JTree that came with the sdk pack and wrote my own tree renderer. However I dont know how to get rid of this particular icon :
    http://www.bubble-media.com/Uploads/icon.gif
    Does anyone know how to get this to not show ?
    Thanks

    Here's a small example:
    JTree tree = new JTree();
    // ... and somewhere after :
    Icon openIcon = new ImageIcon(getClass().getResource("images/show-minus4.gif"));
    Icon closedIcon = new ImageIcon(getClass().getResource("images/show-plus4.gif"));
    ((javax.swing.plaf.basic.BasicTreeUI) tree.getUI()).setExpandedIcon(openIcon);
    ((javax.swing.plaf.basic.BasicTreeUI) tree.getUI()).setCollapsedIcon(closedIcon);       

Maybe you are looking for

  • Inserting a question in to an existing quiz

    Hi, We're using version 6.1 of Presenter in PowerPoint 2000 and 2003. We're trying to insert a question in to the middle of an existing quiz. When I add a question in the quiz manager the newly inserted question overwrites one of my my existing quest

  • Spits out OS 10.4.6 install DVD

    I recently bought the family pack version of the OS 10.4.6 software and installed it on an old iMac other than the one below (upgraded the hard drive as well). But the reason I'm here is because when I tried to update the newer iMac (500 MHz 20 GB) i

  • MacBook Pro freezes overnight

    Every once in awhile, I will forget to put my MacBook Pro to sleep before I go to bed. Without fail, in the morning when I try to wake it from sleep, it's frozen. The machine is still on and the screen is black, but no matter what you press on the ke

  • IOS 8 - send and receive iMessages

    With iOS 7, I used to be able to receive iMessages at two phone numbers. There was an option under iMessage - Send and Receive.  I used that to monitor my son's messages. Now with iOS 8, I can only see my phone number under Send and Receive, and some

  • Error: Metadata of component EquipmentShipment is not valid!

    Hello all, I have created one webdynpro DC -A which has two DCs as used DC- B & C. Now everything builds & runs fine on local server. but when I activate DC "A" gives build errors, as it does not get reference for DC -B. Here is the error: "Error: Me