How to change TreeControl's icons?

I add the following line to jbInit()
((TreeControl.TreeControlTree.TreeControlNodeRenderer)(treeControl1.getTree).getCellRenderer))).
setLeafIcon(new ImageIcon"e:/images/middle.gif"));
It's no work.
Thank you!

The answer is the following code:
private class MyRenderer extends DefaultTreeCellRenderer {
ImageIcon tutorialIcon;
public MyRenderer() {
tutorialIcon = new ImageIcon("kongimgs/cloud.gif");
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);
if (leaf) {
setIcon(new ImageIcon("kongimgs/note1.gif"));
setToolTipText("This is person.");
} else {
setToolTipText(null);
if (leaf && hasFocus)
setIcon(new ImageIcon("kongimgs/point.gif"));
Object _root=tree.getModel().getRoot();
if (null==_root)
System.out.println("root=null");
if (value.equals(_root))
setIcon(new ImageIcon("kongimgs/home.gif"));
//? if (((DefaultMutableTreeNode)value).getParent().equals(_root))
//setIcon(new ImageIcon("kongimgs/plus.gif"));
String str =((TreeControlNode)value).getName();
int index = str.lastIndexOf("-GW");
if (index >0) {
setToolTipText("This is Gateway.");
setIcon(tutorialIcon);
index = str.lastIndexOf("test");
if (index ==0) {
setToolTipText("This is Link.");
setIcon(new ImageIcon("kongimgs/link.gif"));
return this;
JTree _tree =treeControl1.getTree();
_tree.setRowHeight(-1);
_tree.setCellRenderer(new MyRenderer());
null

Similar Messages

  • How to change the application icon in 10g

    Dear all,
    how to change the application icon in forms 10g. i mean the icon which is located on the window it self.
    Best Regards,
    ShoooSh

    Hello,
    <p>Maybe you could find a solution in this article</p>
    Francois

  • How to change Topic's Icon and show the Print Button

    Hi, currently i'm using robohelp html version 8. I have spent quite some time to figure out how to change topic's Icon and show the Print Button in my project. Anyone can help me on this? Btw, i using MX(template) to generate the output with FlashHelp Pro.
    Below is the screenshot for clearer clarification:
    Thanks.

    We would have told you if there was.
    Sorry but a downside of FlashHelp is that your customising options are limited.
    See www.grainge.org for RoboHelp and Authoring tips
    Follow me @petergrainge

  • How to change the web icon in the browser window

    i have created my site and cant find how to change the icon in the browser window (like they have done at the top of this page with the Adobe icon before the  Adobe Forums: text )would anyone be kind enough to give me some help??

    Do you mean the favicon?
    I only just recently learned about favicons myself - so if you google the word you'll get lots of resources for it. Bascially it's a little icon file that sits at the root directory of your site that the browsers find and display for you. As long as the file is there (*named favicon.ico*) it will show up automatically if I'm correct in what I've read.
    Is this the thing you're looking for? (edit: it also shows up in your bookmarks list in firefox - if this is the one you want that's the favicon file)

  • How to change mac desktop icons

    I want to change my Macintosh HD icon to an icon of iMac. Where do I find this and do it?
    I also want to change other HD icons on desktop - how is this done in Mavericks?
    Thanks,
    Don

    Here are some cool icons:
    #1:
    http://www.google.com/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8& docid=K-Wt1TGwSJP-EM&tbnid=zkZ7DRuBycJmCM:&ved=0CAIQjBw&url=http%3A%2F%2Fsimplei con.com%2Fwp-content%2Fuploads%2Fimac.png&ei=ncdVU6TSMI_QsQS7mICwBg&bvm=bv.65177 938,d.b2I&psig=AFQjCNGn1t7gW_X0QFsVJnTTwBOnpqwkSg&ust=1398216982703961
    #2:
    http://www.google.com/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8& docid=RseTXyUI3pgvCM&tbnid=JjX8VdLRJggvuM:&ved=0CAIQjBw&url=http%3A%2F%2Ffiles.s ofticons.com%2Fdownload%2Fobject-icons%2Fmac-icons-by-iconshock%2Fpng%2F512%2Fim ac.png&ei=rcdVU5vcL83gsATI8ILYCQ&bvm=bv.65177938,d.b2I&psig=AFQjCNGn1t7gW_X0QFsV JnTTwBOnpqwkSg&ust=1398216982703961
    They're in .png extention, you can convert them into .icn by a simple app like Img2icn or even use the online converter. Barney-15E answered the rest.

  • How to change .mp3 preview icon to album art

    It may be silly but I was wondering how you can change the preview icon of my music to the album art of the songs..
    When you go onto Finder and youre on the "all my files" tab, most of my songs have a music note for an icon and I'd like to change that to the album art! Anyone know how!?

    Click the Firefox button, go to Options | Options | General and in the Downloads menu, checkmark the radio button called "'''Always ask me where to save files'''". See screenshot.
    Incidentally, some of your plugins are seriously out of date which exposes your system to exploits. Please visit the [http://www.mozilla.com/en-US/plugincheck/ Plugins Check] page and update where necessary.

  • How to change the Control icon in window

    hi to all
    this is my first post to thiss forum and im using java swing for desktop application im facing a little problem is that how to change control icon on window created by java swing example is here
    http://i108.photobucket.com/albums/n15/zerocool_007/window.jpg
    how to change the red circuled icon any simple code tips will help mee
    zero

    myJFrame.setIconImage(img);
    where img is an Image object.
    The easiest way to create an Image is the following:
    Toolkit toolkit = Toolkit.getDefaultToolkit();
    Image img = toolkit.getImage("myImage.jpg");
    remember you need to import java.awt.Toolkit at the top of your class.
    Good Luck,
    Eugene

  • How to change "view as icon" setting for several controls/indicators at same time?

    I got a LabVIEW application from other people. Unfortunately, all of controls and indicators are displayed as icon on block diagram. How can I do the batch change for these kind of setting?
    Thanks in advanced.

    Christian, that only works on new terminals.
    You can find a VI which does this here. If you want the ability to do this yourself, you should do a search for "LabVIEW scripting" and read about it first.
    Try to take over the world!

  • How to change colors and icons

    How can I change the icon colors in iOS7 and how can I make the wallpaper (kids picture) that fit on previous version fit do I can see faces instead of an icon. I have only one icon on front page.

    Icon color cannot be changed. Only the developer of that app can do that.

  • How to change the project icon in iMovie

    When creating a project in imovie 10.0.6 a picture appears as an icon in projects. How do I choose the picture I want as the icon?

    Hello,
    <p>Maybe you could find a solution in this article</p>
    Francois

  • How to change Flash Drive icons (mine shows as a default)

    Why does This keep happening ? on every mac my Flash drive has the icon but on mine it shows like this

    I always have converted .png files to .icns files. You can do this for free from iconverticons.com. Click on Use iConvert icons Online.
    I think the following might work when using the .png file.
    Open the .png file in Preview
    Press Command+A to select the entire image
    Press Command+C to copy the selection
    Do a Get Info on Macintosh HD and click the thumbnail icon to select it
    Press Command+V to paste the image

  • I have the Answer on how to Change the House Icon name

    You go on to
    System Preferences > Acounts > Then unlock the security settings
    Right Click on your Account Name
    Click Advanced Options
    Then simply Change the Account Name there.
    Save it and you are done.
    An easy way to change the name of your Main Folder - the one that looks like a House!

    The problem with this, is some applications use the username to judge where they are installed.  For those, changing the account name may disable certain DRM for those applications.  This tip of yours would probably be best posted to the operating system you've tested it on forum, and not the iMac PPC forum, as that's just for one machine, and not every machine that has that operating system.

  • How To Change Mouse Cursor Icon To Hand And Click Middle Of Player To Pause In Strobe Media Playback

    Hello,
    Thank you for providing a platform where uses can pose questions to Adobe employees. This certainly helps us all cut right through it.
    Similar to YouTube's player (as well as many others), I was wondering if it is currently possible for users to enable functionality on Strobe Media Playback to change the mouse cursor to a hand/point cursor upon hovering over Strobe Media Playback's buttons (such as pause, the volume controls and that initial large centered middle play button),
    And, whether or not it is currently possible to enable functionality to pause/play videos merely by clicking the middle of the video screen (within the normal view mode as well as the full screen mode). Again, with YouTube, Vimeo, JW Player, and many others, such functionality is currently built-in by default.
    I look forward to any advice you are able to provide. Thanks again for providing this discussion platform for users.
    - C.R.

    Hi, thank you for your suggestions and for the interest in our player.
    The full area click issue is an older one, tracked at http://bugs.adobe.com/jira/browse/ST-156 . Unfortunately, it will not be fixed in this release.
    The hand cursor issue is now tracked at http://bugs.adobe.com/jira/browse/ST-331 - thanks for suggesting it!

  • How to change the default JAD Icon image in JStudio

    Dear friends,
    I have one dought,how to change the default icon JAD image in jstudio application.Its very important to me.And one find answer please tell .

    Dear friends,
    I developed one application in jstudio.And need to set an special icon for my application.While i download my application in to mobile. The icon should be displayed in the mobile.To show my application as unique from other applications.But i dont know how to set an icon for my application. If any one find answer please reply as soon as possible.
    Thank you

  • How to change screen icons and album art?

    Does anyone know of an application, or otherwise know how to change the screen icons individually, one at a time? I don't mean adding or changing to a different summerboard. Ideally, I'd like to change a few of the icons to either photographs from my files, or to some other photo or drawing of my choosing.
    While I'm asking questions, another one concerns album covers in iTunes. ITunes gives you the ability to add more than one cover to an album but I can't see how to display one other than the original one added. Also, I can't see how to delete a cover once it's been added. I was manually adding cover art for albums that didn't have any and accidently put the wrong picture on one album. Nothing I have been able to do allows me to delete that picture. I did add the correct picture but I can't get it to display. Of course, whatever I do in iTunes I'd like for it to properly sync to the touch.
    Any ideas???

    As for your first question, there is no way of changing icons without jailbraking, which we're not allowed to discuss here.
    To view more than one artwork, simply click on the little arrow appearing in the artwork window.
    To delete it, right-click, Get Info -> Artwork and delete the picture.
    Hope this helps.

Maybe you are looking for