HTML in TreeCellRenderer (JLabel) really slow

Hi,
I've used HTML in my TreeCellRenderer to make the node (ie the JLabel) display a formatted text, both bold and italic + an icon. It looks great, but it's really slow. I've run it through JProbe and it seems like the call to label.setText(x) creates thousands of extra objects and is taking a lot of time. Is there a way around this?
I've searched the forums but can't find a soultion. I also found this:
http://developer.java.sun.com/developer/bugParade/bugs/4792592.html
What I want is to be able to change color for each node in the tree plus use bold and italic text within the same label.
/s

I had this problem with setting HTML on all the cell in a JTree.
The problem is caused by the renderer parsing the html and building a view like a JTextArea does. This is what causes the large number of objects to be created. This is done every time the cells are painted which is a big problem when scrolling the tree.
To solve it I extended the DefaultTreeCellRenderer to cache the generated html views as they are created using the client property called "html" as follows:
public class FastHTMLCellRenderer extends DefaultTreeCellRenderer {
    Map views = HashMap();
    public Component getTreeCellRendererComponent(JTree tree, Object value, boolean
             selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
        Object view = views.get(value);
        if(view==null) {
            // generate the html for the value
            setText("<html>....." + value + "</html>");
            views.put(value, getClientProperty("html"));
        else {
            putClientProperty("html", view);
}This improves the performance dramatically but has the issue that the views should be removed from the cache when the values are removed from the tree model.
This also applys to JTables and other CellRenderers.

Similar Messages

  • Time Machine won't back up. Starts of REALLY SLOW, and the errors out.

    I've been having a hard time getting time machine to back up. To start off I'll give you my specs and what I have done.
    iMac
    OS 10.6.6
    2.4 GHz Intel Core 2 Duo
    4 GB 667 DDR@ SDRAM
    320 GB HD
    All software updates are current. I am trying to back up to an external Western Digital 1 GB drive connected by USB2. I have formatted the external drive, and set a single partition on that drive from the Disc Utility. I have run disk repair on both the external and local hard drive. I have run disk repair permission on the local drive. I have restarted, after every time. I have done everything listed above multiple times, and have done them all in kinda different orders each time.
    My thought is that the issue may not be with the hard drives, but maybe a file its trying to back up. When it starts out for the first time, it tells me that it needs to back up over 100 GB of data. It gets about halfway done, and then errors out. When I try to start it again, it tells me that it needs to backup around 50 GB of data. And this time, its REALLY slow. Like bytes slow, not Mega bytes, or even kilobytes. Bytes. 36 bites backed up, 120 bytes backed up. 2 Kilobytes backed up. SLOW SLOW SLOW.
    Then it picks up, and usually gets up to 120 MB, and then gives me this error message "The Backup was not performed because an error occurred while copying files to the backup disk. - The problem may be temporary. Try again later to back up. If the problem persists, use Disk Utility to repair your backup disk."
    Its a pretty generic message, and gives me no help in trying to figure out what the problem is. I've been trying again for almost 3 days now, and nothing is working. Is there an error log file that I can go find that would help me a little more?

    woody24 wrote:
    "The Backup was not performed because an error occurred while copying files to the backup disk. - The problem may be temporary. Try again later to back up. If the problem persists, use Disk Utility to repair your backup disk."
    See #C3 in [Time Machine - Troubleshooting|http://web.me.com/pondini/Time_Machine/Troubleshooting.html] (or use the link in *User Tips* at the top of this forum).
    Its a pretty generic message, and gives me no help in trying to figure out what the problem is. I've been trying again for almost 3 days now, and nothing is working. Is there an error log file that I can go find that would help me a little more?
    Tell Apple about the inadequacy of that message: http://www.apple.com/feedback/timemachine.html

  • Safari being REALLY slow or sometimes "Cannot find server"! HELP!

    Right, i have the new 'Safari 4' but its being really slow.
    When trying to load up webpages, it sometimes takes AGES to load a page, or sometimes it even comes up with the message 'Safari cannot find the server'.
    I have 'LittleSnitch' installed so I can see when Safari is using the internet to either upload or download information and most of the time, Safari is sat there doing nothing and not downloading any information...
    I have reset Safari to no avail!
    Why might this be happening?
    Message was edited by: Ozzmystro

    'Safari cannot find the server'
    Generally refers to a DNS problem.
    (First, if yours is an Intel Mac, check that Safari is not running in Rosetta, which is enough to slow it to a crawl.)
    Adding DNS codes to your Network Settings, should gives good results in terms of speed-up:
    Open System Preferences/Network. Double click on your connection type, or select it in the drop-down menu. Click on TCP/IP and in the box marked 'DNS Servers' enter the following two numbers:
    208.67.222.222
    208.67.220.220
    (An explanation of why that is both safe and a good idea can be read here: http://www.labnol.org/internet/tools/opendsn-what-is-opendns-why-required-2/2587 /
    Open DNS also provides an anti-phishing feature: http://www.opendns.com/solutions/homenetwork/anti-phishing/ )
    Whilst in System Preferences/Network you should also turn off 'IPv6' in your preference pane, as otherwise you may not get the full speed benefit (the DNS resolver will default to making SRV queries). If you want to know what IPv6 is:
    This is Apple's guidance on iPv6:
    http://docs.info.apple.com/article.html?path=Mac/10.5/en/8708.html
    Click on Apply Now and close the window.
    Restart Safari, and repair permissions.

  • IPad really slow

    Hi my iPad is really slow and keeps saying its low in memory even although I have purchased iCloud storage

    It is probably referring to Low Memory on the Device itself...
    Getting additional iCloud Storage will not resolve your issue.
    You need to Delete content off your iPad.
    Have a look at your Movies, Photos and Music and see what can be deleted and/or transfered to your computer.
    Managing Storage on iOS Devices
    http://macmost.com/managing-storage-on-ios-devices.html
    First
    Try This...
    Close All Open Apps...  Perform a Reset... Try again...
    Reset  ( No Data will be Lost )
    Press and hold the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears. Release the Buttons.
    http://support.apple.com/kb/ht1430
    Also consider Deleting any Apps you have Purchased / Downloaded but you now never use..

  • In After Effects, it says NOT Realtime and the video is really slow

    I'm editing a clip in after effects and the video preview is really slow. I also says in the preview section, "NOT realtime".

    How, exactly, are you initiating the preview? Are you using RAM preview?
    See this:
    http://helpx.adobe.com/after-effects/using/previewing.html
    Start here to learn After Effects: http://adobe.ly/bjBT3P

  • My Macbook pro 2011 suddenly has a really slow bootup. What can I do?

    My Macbook pro 2011 suddenly has a really slow bootup. What can I do? I did install a cannon printer upgrade and security upgrade. Not sure if it was something to do with that. Also I tried the disk utility repair and didn't improve anything. I also reset PRAM and SMC.

    1. Try booting in e Verbose mode - press and hold [cmd] + [v] keys just right after the boot chord sounds till you get a black screen and white letters.
    if there are some delays in the boot process  -  you should see where the system is stuck.
    this mode is not permanent - the next [re-] boot will be normal.
    2. repair permissions. disk utility does fine. Disk Warrior is better.
    sometimes after half done updates (it may happen though should not) there are items that are "belonging to someone else"
    3. try  cache cleaner (or there are some other utilities as well - I just like SlCC  more)  http://www.northernsoftworks.com/snowleopardcachecleaner.html - it's shareware though the basic functionality is free for you to use.
    Try caches -> deep cleaning (please read the developers site what it does) and select checkmark at all options - reply yes to the requests and after a reboot the next reboot should be as it is intended.
    p.s be sure you do have backup  

  • Internet Really slow on OSX tiger

    the past week or so internet has been really slow on OSX however since I have vista installed as well I checked it on vista and internet runs great under vista.
    what could be slowing down the internet on OSX.
    also tryed multiple browsers on OSX none of them run good now.

    How much free space do you have on your HD?
    Look at these links
    52 Ways to Speed Up OS X
    http://www.imafish.co.uk/articles/post/articles/130/52-ways-to-speed-up os-x/
    Tuning Mac OS X Performance
    http://www.thexlab.com/faqs/performance.html
    11 Ways to Optimize Your Mac's Performance
    http://lowendmac.com/eubanks/07/0312.html
    The Top 7 Free Utilities To Maintain A Mac.
    http://mac360.com/index.php/mac360/comments/thetop_7_free_utilities_to_maintain_amac/
    Mac OS X: System maintenance
    http://discussions.apple.com/thread.jspa?messageID=607640
     Cheers, Tom

  • Please help with my G4 Quicksilver - It's really slow !!!!!

    How do I optimize performance easily for my G4 Quicksilver 733 MHz ??? I just replaced my power supply and I'm back up again but things are really slow including my DSL internet connection

    How much RAM do you have? What size hard drive do you have & how much free space? A small amount of RAM & an almost full hard drive will really slow things down.
    Look at these links
    Mac Tune-up: 34 Software Speedups
    http://www.macworld.com/article/49489/2006/02/softwarespeed.html
    52 Ways to Speed Up OS X
    http://www.imafish.co.uk/articles/post/articles/130/52-ways-to-speed-up-os-x/
    Tuning Mac OS X Performance
    http://www.thexlab.com/faqs/performance.html
    11 Ways to Optimize Your Mac's Performance
    http://lowendmac.com/eubanks/07/0312.html
    The Top 7 Free Utilities To Maintain A Mac.
    http://mac360.com/index.php/mac360/comments/thetop_7_free_utilities_to_maintain_amac/
    Mac OS X: System maintenance
    http://discussions.apple.com/thread.jspa?messageID=607640
     Cheers, Tom

  • After effects & Illustrator really slow on a fast computer :S

    In serious need of a computer genius. I have a computer that should have a great performance although till now it's acting frustratingy slow with the Adobe Programs. I have the legal Adobe Creative Cloud. I mainly use Illustrator and After Effects and that is where I noticed the problems.
    Illustrator: slows down over time. Over a period of half an hour the program gets extremely slow and laggy (happens with every project).
    After Effects: Is really slow with rendering. Also RAM render goes extremely slow even with very very simple projects. (even a shape layer that only moves from the left to the right is RAM rendering frame per frame and takes half a second to render every frame -_-).
    It's not workable. I have tried all kinds of forums and have all the settings of After Effects optimized.
    My windows device Manager and System Information sais that everything is working ok. The RAM is detected by the System and also After Effects detects the RAM.
    I don't know what the f*** is wrong.. Who can help me out?
    This are some specifications of my computer. If you need any more info let me know.
    OS Name Microsoft Windows 7 Home Premium
    Version 6.1.7601 Service Pack 1 Build 7601
    System Model MS-7751
    System Type x64-based PC
    Processor Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz, 3401 Mhz, 4 Core(s), 4 Logical Processor(s)
    Display adapters NVIDIA GeForce GTX 660 Ti
    Disk Drivers Samsung SSD 840 PRO Series ATA Device
      WDC WD20EURS-63S48Y0 ATA Device
    BIOS Version/Date American Megatrends Inc. V10.8, 12/17/2012
    SMBIOS Version 2.7
    Installed Physical Memory (RAM) 32.0 GB
    Total Physical Memory 16.0 GB
    Available Physical Memory 13.6 GB
    Total Virtual Memory 32.0 GB
    Available Virtual Memory 29.7 GB
    Page File Space 16.0 GB

    Hi 421321312,
    Please refer the following help article from the illustrator point.
    http://helpx.adobe.com/illustrator/kb/optimize-performance-illustrator-cs4-cs5.html
    Hope this helps,
    Regards,
    Sumit Singh

  • IBook G4 starting up really slow

    Hello,
    I'm having some trouble with my iBook G4. It's starting up really slow. Even if it's only sleeping. I ran a hard drive test, no problems there, it said. The computer starts up and then works normally, but it's a really long wait.
    Any ideas what could be the problem? It shows the apple logo and the "moving circle" for a long time. I'd appreciate help!

    annasip,
    They checked it and found out nothing, and my iBook started up normally there
    Doesn't that always happen.
    When the computer is having problems starting up, it makes this noise, like the same sound over and over again, sounds a bit like something is stuck. (pretty hard to describe when not speaking my mother tongue)
    Uhhh your English is pretty d.. good. As good as most of us around here. Better than my Finnish...suomi something tu...
    Anyway that sounds like hard drive problems.
    (I just bought an external hard drive so space shoudn't be the problem)
    FireWire I hope so get that puppy started up again and Carbon Copy Clone your entire hard drive to your external Firewire:
    http://www.bombich.com/software/ccc.html
    It's shareware so I have paid them something after using it like 50 times.
    Once that's done you should be able to bootg up from your external drive. If that's slow you could try repairing disk permissions from Disk Utility (Did we talk about doing that on the internal drive also?)
    If you continue to have problems you might have to repair or reinstall the OS on that external. Don't mess with the internal since it seems to be dying and we want to keep that alive as long as possible.
    Richard

  • Really slow start up on my MBA

    I read some posts, and tried most of the suggestions but still really slow.
    I tried: cleaning computer and deleting files, also got rid of Bootcamp which I don't use Windows, ran MacKeeper, also removed all Login Items under accounts. It takes 1min 45 secs to get to the blue screen, and another minute to finally get all the icons in place.
    Help.

    Welcome to Apple Discussions!
    Try cleaning up your Mac*:
    http://www.macmaps.com/diskfull.html
    And try repairing permissions and directory after a backup*:
    http://www.macmaps.com/backup.html
    http://www.macmaps.com/directoryfaq.html
    - * Links to my pages may give me compensation.

  • IMac operating really slow

    Hi, I have a G5 iMac, which for the last couple of weeks has been operating really slow. I've tried re-starting it, re-setting my Airport, in case it is internet related but it still keeps operating slowly. I get the spinning beach ball while it is thinking and then finally it functions, only to happen again. Occasionally, I get normal operating speed but then it happens again. I'm just going through a software update to see if there's anything I've missed out but is there anyone who is having the same problem, and is there anything anyone can recommend?

    Not sure if this is related, Brett, but Apple have just released a new KB page detailing a problem which can occur when using some 3rd party VPN software under OSX 10.4.8:
    Issue or symptom
    After updating to Mac OS X 10.4.8, if some third-party VPN client software is installed, Activity Monitor may show the AirPort process taking 90% or more of the CPU time, and the computer may seem "slow".
    Products affected
    Mac OS X 10.4.8
    Airport
    Solution
    Make sure your third-party VPN client software is up-to-date. Contact your network administrator or the manufacturer of your VPN client software.
    This document will be updated as more information becomes available.
    (from http://docs.info.apple.com/article.html?artnum=304798 )
    Not sure if this applies to you, but worth considering.
    Regardless, you might want to start up Activity Monitor (in your utility folder), open the "Activity Monitor" window, and then choose "active processes" to see if this, or some other software, is hogging your processor.
    Cheers
    Rod

  • TS1398 My ipad3 seems to have connection issues. It is wifi only but keeps losing the connection and is really slow in loading pages - a bit like dial-up speed!  My iPhone 4s and daughters'  ipad2 have no problems at all. Any ideas anyone?

    My ipad3 seems to have connection issues. It is wifi only but keeps losing the connection and is really slow in loading pages - a bit like dial-up speed!  My iPhone 4s and daughters'  ipad2 have no problems at all. Any ideas anyone?

    Look at iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    iOS: Recommended settings for Wi-Fi routers and access points  http://support.apple.com/kb/HT4199
    Additional things to try.
    Try this first. Turn Off your iPad. Then turn Off (disconnect power cord) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    Go to Settings>Wi-Fi and turn Off. Then while at Settings>Wi-Fi, turn back On and chose a Network.
    Change the channel on your wireless router. Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    Another thing to try - Go into your router security settings and change from WEP to WPA with AES.
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    If none of the above suggestions work, look at this link.
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
    ~~~~~~~~~~~~~~~
    If any of the above solutions work, please post back what solved your problem. It will help others with the same problem.
     Cheers, Tom

  • Ipod syncing really really slow

    my ipod touch sync is really slow. I mean its like 30 songs per 10 minutes. My ipod finished charging completely (3hours) from a red bar before it finished syncing... This just started happening yesterday. I have had this ipod for about a month and a half. Before anyone starts saying disable your anti-virus or your anti-virus is scanning the songs. It is not my anti-virus. I am using usb 2.0. I did try different usb ports and that didn't help. I do have a nano that i synced and it doesn't seem to be that bad on it. It is a lot faster than my touch but it is still slow. I don't know why this is happening. One more detail. would it matter if the memory is filled up that makes it so slow? I mean completely filled. I have a usb 1.0 device and thats faster to put songs on than to sync my ipod touch lol. Thanks!

    Hey,
    Make sure you have the latest version of iTunes. http://www.apple.com/itunes/download/
    This is most likely a USB connection issue. Try disconnecting the other USB devices, other than the keyboard and mouse, then directly connect the iPod touch to the computer.
    This article: http://support.apple.com/kb/TS1286 provides general tips for troubleshooting USB connections.
    If the issues persist, try restoring the iPod. http://docs.info.apple.com/article.html?artnum=305744
    -Jason

  • Photoshop CS6 won't launch and when it does it's really slow...help?

    Hi,
    So my copy of Photoshop CS6 sometimes won't launch and when it does manage to launch fully, it's really slow. I mean ridiculously slow. The only times when I can get it to run even remotely quick is if I shut down my computer, and then restart it and then start up Photoshop CS6 as the first program. Even then it slows down after a while. (And I only have a firefox browser open usually, never more than a couple of tabs at once, so it's not a bandwidth issue)
    Here are my comp specs:
    Samsung
    Processor:
    AMD A6-3420M APU with
    Radeon (Tm) HD graphics 1.50 ghz
    Installed Memory (RAM) - 4.00 (3.48 usable)
    64 Bit operating System running on Windows 7 home premium, service pack 1
    I also did just recently install the new update Adobe had for Photoshop, so that's up to date.
    It's getting really frustrating! I have another program I'm using in the meantime (Paint tool Sai), but I'd really like to use Photoshop CS6.....
    Any help would be greatly appreciated!

    Make sure you updated the drivers from AMD's website, not Microsoft.
    Make sure you are running the 64 bit version of Photoshop, not 32 bit.
    Disable all third party plugins, and try disabling system utilities (we've seen font managers, antivirus, disk backup software, etc. cause slowdowns due to bugs in those utilities).

Maybe you are looking for

  • Problems in startup class (MDB on Weblogic 7.0 / IBM MQ)

    Hello friends,           I am trying to communicate with IBM MQ through Weblogic 7.0 SP2 and           using MDB.           This is a bit strange but I had to reinstall Weblogic and I tried to           deploy the Startup class . However I am getting

  • Highlight row in standard report based on value in column...

    I am trying to highlight rows of a standard report based on the value of the column TICKET_TYPE. I have been following the post: Highlighting a ROw in a tablular form based on a column in the row but having difficulty. I receive the following error:

  • How can I find the Mac app store if there is one?

    I have one Apple ID. When I enter my Apple ID on my Mac I can only access apps for my ipad and iphone but not my Mac. Is there a mac app store?

  • Deltas in F I

    Hello Gurus, How is the Delta management in FI related, datasources? Are there Delta queues involved ? Does data get immediately reflected in the RSA7, after new records are added in R3, after a Initialization in BW? Thanks in advance. Full points to

  • Please could someone help me?

    Hello My name is Tob�as I want to do a program to read the stdinput (keyboard), to do this I do two classes( one as main and one as Keyboard Reader) .When I Compile the two classes There is not any problem. I send this mail because when I run this pr