Having trouble with JCheckBox and JTree

I am trying to render the JTree to display JCheckBox's instead of just ordinary JLabels.
It's fine, compiles, and when you view it it looks normal, until you try to check one.
You can't check it at all.
What am i doing wrong with this?
Thanks

OK, here it is...
public class EmotiTreeCellRenderer extends DefaultTreeCellRenderer {
     protected JCheckBox label;
     public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
          if ( value instanceof DefaultMutableTreeNode ) {
               label = new JCheckBox();
               label.setOpaque( false );
               if ( selected && hasFocus ) {
                    label.setForeground( Color.blue );
               DefaultMutableTreeNode node = (DefaultMutableTreeNode)value;
               Object userObject = node.getUserObject();
               if ( userObject instanceof Emoticon ) {
                    Emoticon emoticon = (Emoticon)userObject;
                    String icon = emoticon.getIconKeys();
                    try {
                         label.setText( "<html><body><img src=\"" + new File( emoticon.getRealPathToEmoticon() ).toURL().toString() + "\" alt=\"" + parseAlt( icon ) + "\"> " + parseAlt( icon ) + "</body></html>" );
                    } catch ( MalformedURLException mfe ) {
                         label.setText( "<html><body>" + parseAlt( icon ) + "</body></html>" );
                    return label;
               } else if ( userObject instanceof EmotiPack ) {
                    EmotiPack pack = (EmotiPack)userObject;
                    label.setText( pack.getName() );
                    return label;
          return super.getTreeCellRendererComponent( tree, value, selected, expanded, leaf, row, hasFocus );
     protected String parseAlt(String html) {
          return html.replace( "<", "<" ).replace( ">", ">" ).replace( "\"", "&#34;" );
}

Similar Messages

  • Just bought a new iPhone and am having trouble with iTunes and App Store. I can log in to Cloud, iTunes, and app store but once I try to download, it says "Youe apple id has been disabled". I've reset my password three times and have no issue on my Pad.

    Just bought a new iPhone and am having trouble with iTunes and App Store. I can log in to Cloud, iTunes, and app store but once I try to download, it says "Youe apple id has been disabled". I've reset my password three times and have no issue on my Pad.

    Hi FuzzyDunlopIsMe,
    Welcome to the Support Communities!
    It's possible that resetting your password multiple times has triggered this security.  Click on the link below for assistance with your Apple ID Account:
    Apple ID: Contacting Apple for help with Apple ID account security
    http://support.apple.com/kb/HT5699
    Here is some additional information regarding your Apple ID:
    Apple ID: 'This Apple ID has been disabled for security reasons' alert appears
    http://support.apple.com/kb/ts2446
    Frequently asked questions about Apple ID
    http://support.apple.com/kb/HT5622
    Click on My Apple ID to access and edit your account.
    Cheers,
    - Judy

  • Several of us have a iPhone 6s and are having trouble with hearing and speaking at the same time when using the phone. ? The speakers seem to be too far apart? Are others having this issue? Solutions?

    Several of us have a iPhone 6plus and are having trouble with hearing and speaking at the same time when using the phone. ? The speakers seem to be too far apart? Are others having this issue? Solutions?

    Not having the problem, don't personally know anyone who is.

  • I'm Having trouble with OWA and Certs after the Rollup 7 for SP3 installation. any idea? update 2961522-

    Hi, everyone.
    I'm Having trouble with OWA and Certs after the Rollup 7 for SP3 installation. any idea? update 2961522-
    after running get-OWAVirtualDirectory or test-OWAConnectivity i'm getting a message that says "OWA it's Orphan, No Metadata information can be found."
    I only have the OWA users impacted.- anywhere users, and ActiveSync are working well.-
    Thanks,
    Fabian Alberto Campo
    MCT-MCSA 2012-MCITP365-MCTS
    Fabián A. Campo H. Consultor tecnico @ IXO Ltda. MCT MCP MCTS MCSA HP-APS Cra. 67 No. 167 – 61 of 303 Bogotá, Colombia

    Hi Fabian,
    Is there any error code when user access their mailbox on OWA. Please confirm if there is no results returned in EMS when you run Get-OWAVirtualDirectory cmdlet. Also check whether there is any Event Logs related to OWA in Exchange.
    In IIS manager, make sure the OWA virtual directory is listed in the Default Web Site. In EMC, we can navigate to Server Configuration > Client Access, select server and turn to Outlook Web App tab. Then we can click Reset Virtual Directory in the right
    Actions pane to reset OWA virtual directory.
    Additionally, please restart IIS service by running iisreset /noforce from a Command Prompt window.
    Regards,
    Winnie Liang
    TechNet Community Support

  • I have an iPhone and just goy I pad but no computer I'm trying to synch them together but having trouble with iCloud and I can't seem to subscribe for iTunes match from either devise

    I have an iPhone and just goy I pad but no computer I'm trying to synch them together but having trouble with iCloud and I can't seem to subscribe for iTunes match from either devise

    You first have to subscribe to iTunes Match through iTunes on your computer and have your music library in iTunes uploaded/matched before you can enable it on your iOS devices (see http://www.apple.com/itunes/itunes-match/).  Without a computer you won't be able to use iTunes Match.

  • Having trouble with itunes and windows 8

    anyone else having trouble with windows 8 and itunes?  My computer doesn't seem to recognize my shuffle.

    A simple search would have answered such a silly question.

  • Anyone having trouble with Splashtop and Maverick?

    Splash top will not run since installing Maverick.  I have uninstalled and reinstalled, but still no go.  Anyone else?

    I've been having trouble with this since I upgraded to iOS 7.0.2! Logged on tonight to see where I could log the problem with apple to get to fix in the next update! Seen on Facebook that others having same issue.
    I've also had a problem that when I put phone in to airplane mode it isn't reconnecting to the network afterwards!

  • Having trouble with flash and linking to Sliding panels - PLEASE help

    Having trouble with Sliding panels and flash. Otherwise everything works fine but when I'm trying to implement the link
    <a href="#" onclick="sp1.showPanel('panel1'); return false;">Panel1</a>
    to a flash button I get confused. I have tried following
    on (press) {
    getURL("javascript:sp1.showPanel('panel1');");
    and it did not work. What would you suggest? I am desperate. Please help me! Any suggestions are highly appreciated!!!!

    Thanks for your answer!
    I have tried both sp1.ShowPanel('panel1'); and window.sp1.ShowPanel('panel1'); they both give blank window with [object]
    I have found a solution that works in other browsers, but not in IE. Well basicly it works, but after a few clicks IE freezes.
    on (press) {
    getURL("javascript:sp1.showPanel('panel1'); void(0);");
    Would you happen to have a solution other than that? I believe that the void(0); causes the IE to freeze.

  • Having trouble with Dreamweaver and fireworks willing to pay for support

    I'm new to the forum and i was hoping to get some help with
    dreamweaver and fireworks.
    I built a site on my own using dreamweaver 3 years ago but
    have forgotten almost everything. I am planning on building a new
    web site and have been messing with dreamweaver for over a week
    trying to figure it out, with little success. I bought a web
    building package years ago that included fireworks, dreamweaver,
    freehand and maybe more, but i lost my books on dreamweaver and
    fireworks somehow.
    Anyways, I was trying to learn dreamweaver 3 and fireworks
    and was having a lot of trouble with it. The dreamweaver bible
    assumes you know how to make a navigation bar using fireworks and
    that simply isnt the case for me. So I need help with that.
    Also, i have been having trouble with my template. This is
    how you save your basic page correct? For some reason it doesnt
    save the whole page for me. I figured out the editable regions
    part, I think, but since i didnt know how to make a navigation bar
    I made my own links out of text, and this part isnt saving with the
    template.
    I have a lot more questions but i think ive taken enough of
    your time. I am willing to pay someone to help me build this site,
    i cant afford a lot but i think my questions are pretty basic.
    Thanks

    There is a recent thread on the FW forum that may interest
    you - it's called
    "Firworks and HTML". The advice there applies in your case,
    too.
    One problem with your use of DW3 is this -
    the browser world has changed quite a bit in the almost 10
    years since DW3
    was released. Some (many?) of the behaviors in DW3 simply
    won't work any
    more because of these (significant) changes. Are you
    absolutely locked into
    using DW3?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "jfmalewitz" <[email protected]> wrote in
    message
    news:[email protected]
    > I'm new to the forum and i was hoping to get some help
    with dreamweaver
    > and
    > fireworks.
    > I built a site on my own using dreamweaver 3 years ago
    but have forgotten
    > almost everything. I am planning on building a new web
    site and have been
    > messing with dreamweaver for over a week trying to
    figure it out, with
    > little
    > success. I bought a web building package years ago that
    included
    > fireworks,
    > dreamweaver, freehand and maybe more, but i lost my
    books on dreamweaver
    > and
    > fireworks somehow.
    > Anyways, I was trying to learn dreamweaver 3 and
    fireworks and was having
    > a
    > lot of trouble with it. The dreamweaver bible assumes
    you know how to make
    > a
    > navigation bar using fireworks and that simply isnt the
    case for me. So I
    > need
    > help with that.
    > Also, i have been having trouble with my template. This
    is how you save
    > your
    > basic page correct? For some reason it doesnt save the
    whole page for me.
    > I
    > figured out the editable regions part, I think, but
    since i didnt know how
    > to
    > make a navigation bar I made my own links out of text,
    and this part isnt
    > saving with the template.
    > I have a lot more questions but i think ive taken enough
    of your time. I
    > am
    > willing to pay someone to help me build this site, i
    cant afford a lot but
    > i
    > think my questions are pretty basic.
    > Thanks
    >

  • TO ALL THOSE HAVING TROUBLE WITH ICHAT AND AIM ON MACBOOKS

    I've had a lot of trouble with AIM and iChat on my new Macbook, but I believe I've figured out the answers to all the problems I and others have encountered.
    Firstly, for those who's AIM continually crashes and displays the message "The application AIM unexpectedly shut down," my answer to your problem is too many sent messages. Watch the bar in the bottom left of your chat window, when it reaches red, your application will probably shut down.
    Secondly, for those experiencing difficulties with iChat, it's most likely a problem with communitcation between your wireless router and your computer. Try these steps:
    1. From the Apple menu, choose System Preferences.
    2. From the View, choose Sharing.
    3. Click the Firewall tab.
    4. Click New.
    5. From the Port Name pop-up menu, choose Other.
    If you have a Macbook, you'll probably have a TCP Port Number Bar and a UDP Port Number Bar. Try these steps:
    1. In the TCP Port Number(s) Bar, type: 5190, 5298
    2. In the UDP Port Number(s) Bar, type: 1024-5219, 5221, 5223-65535
    3. In the Description Bar, type: iChat AV
    4. Click OK
    5. Click Start above the window with your firewall settings, and make sure the box next to iChat AV is checked
    6. Relaunch iChat
    Good Luck! I hope this solves some of the problems that people have been encountering.

    Rob
    My Linksys is the WAG54G, which might be different from your WRT54G. Currently, UPnP is disabled and the Router ports are a bit of a mystery, because they're forwarded to an IP address that's outside of the current DHCP Address Range! Once I got it working, I was reluctant to change it even though it looked anomalous.
    The Firewall is on, with the iChat ports open that I listed in the previous post.
    My two regular buddies are my sons, who both use Trillian Pro on a Windows machine. Works pretty well despite occasional freezes or garbled sound.
    Hope you get sorted soon.
    Dave

  • I am having trouble with safari and most apps shutting down when I'm in the middle of stuff what do I need to do to resolve this?

    I am havering trouble with safari and apps shutting down on me all the time what can I do to resolve this problem. Thanks :-)

    Make sure you have enough free space on your iPad. With iOS 7 it is recommended that you have 15-20% of the storage space on the device free.  For a 16 GB device that is 2.4-3.2 GB free. For a 32 GB device that is 4.8-6.4 GB free. For a 64 GB device that is 9.6-12.8 GB free.
    Also try a reset. Press and hold the Home and Sleep buttons simultaneously until the Apple logo appears. Let go of the buttons and let the device restart. See if that fixes your problem.

  • Having trouble with pse7 and opening jpg files

    I have been using pse7 for quite some time and today I have started having trouble.  It is as if the program is "not responding" for a time.  So here is what is going on . . . I can open a file or group of files (jpg images) and then when I ctrl+o to open something new I can't see what is in the folders . . . and eventually it won't even let me open anything.  I will ctrl+o and the little blue circle will move, but then go back to the arrow without going to my folders.  I'm not sure if this is making any sense, but it is REALLY frustrating me!!!  I have restarted my computer several times today and it is not helping.  Last week I did update the driver for my printer and now I'm not able to print anything from PSE . . . I don't know if this is part of the problem.  I was getting the "not enough memory (RAM)" message last week as well.  I don't know if all of this is together, but it is driving me crazy!!!  I am in the process of downloading the pse9 trial and I'm hoping that this will help.
    I am working with windows7.
    thank you!!!

    You might have opened several images of large sizes.
    You can go to Edit menu > Preferences > Performance
    Move the slider to the right to increase the memory allocated to PSE
    Also, increase the Cache level.
    Restart PSE Editor
    The problem also can be, that you have several programs running on your system. You might want to close unwanted programs while working on several images in PSE. This also reduces the available memory for PSE to work on.
    Hope this solves your problem

  • Having trouble with rounding and if/else

    I am trying to write a program that reads 2 floating-point numbers and test if they're the same when rounded to 2 decimal places and whether they diff by less than 0.01. I'm having trouble compiling it, with errors such as
    "C:\Documents and Settings\John\My Documents\Test2.java:24: 'else' without 'if' else"
    C:\Documents and Settings\John\My Documents\Test2.java:18: cannot find symbol
    symbol  : method round(double,int)
    location: class java.lang.Math
         double round1 = Math.round(firstinput,2);
                             ^
    C:\Documents and Settings\John\My Documents\Test2.java:19: cannot find symbol
    symbol  : method round(double,int)
    location: class java.lang.Math
         double round2 = Math.round(secondinput,2);Here is the code:
    import java.util.Scanner;
    import java.text.NumberFormat;
    import java.math.*;
    import java.lang.Math;
    public class Test2
         public static void main( String args[] )
         Scanner sc = new Scanner( System.in);
         System.out.println("Enter your first floating-point number: ");
         double firstinput = sc.nextDouble();
         System.out.println("Enter your second floating-point number: ");
         double secondinput = sc.nextDouble();
         double round1 = Math.round(firstinput,2);
         double round2 = Math.round(secondinput,2);
         double total = round1 - round2;
        if(round1 == round2);
        System.out.print("They are the same when rounded to two decimal places. \n");
        else
        System.out.print("They are not the same when rounded to two decimal places. \n");
         if(total<1.01 && total>0.99)
         System.out.print("They differ by less than 0.01. \n");
         else
         System.out.print("They do not differ by less than 0.01. \n");
    }

    Are you restricted to Math.round()? Try reading about DecimalFormat:
    http://java.sun.com/j2se/1.4.2/docs/api/java/text/DecimalFormat.html
    Your code with DecimalFormat:
    import java.text.DecimalFormat;
    import java.util.Scanner;
    public class Test2 {
        public static void main(String[] args) {
            DecimalFormat df = new DecimalFormat("#.##");
            Scanner sc = new Scanner( System.in);
            System.out.println("Enter your first floating-point number: ");
            double firstinput = sc.nextDouble();
            System.out.println("Enter your second floating-point number: ");
            double secondinput = sc.nextDouble();
            double round1 = Double.parseDouble(df.format(firstinput));
            double round2 = Double.parseDouble(df.format(secondinput));
            double total = round1 - round2;
            if(round1 == round2)
                System.out.print("They are the same when rounded to two decimal places. \n");
            else {
                System.out.print("They are not the same when rounded to two decimal places. \n");
                if(total<1.01 && total>0.99) //<== Rather redundant, why not just use total == 1
                    System.out.print("They differ by less than 0.01. \n"); //<== From the above if statement, it seems if you are looking to see if the 2 numbers differ by less than 1.00, and not 0.01. The same goes for the else statement below
                else
                    System.out.print("They do not differ by less than 0.01. \n");
    }Also, when I ran your program with the latter code and entered two same floating point numbers, it also printed out "They do not differ by less than 0.01." I've added curly brackets around the outer else statement to ensure that it does not happen. It's best to use curly brackets in structured statements if their function exceeds more than one line; for stability and legibility.
    Also, read my comments.

  • Having trouble with tablelaoutpanel and flowlayoutpanel.

    I'm trying to make this forms controls expand with the form. After playing with anchoring and autosizing and what not, I'm not having very good luck with it. I think this is going to require some serious hand holding.
    Dick Hutchings

    I give up, it shouldn't be this hard.
    Thanks   Rbie
    Dick Hutchings
    Don't give up! You can take intrinsic control of the placement and sizing of every graphical control. Font sizes can also be managed. The trick is to design your UI on a given
    minimum template (or clientsize - say 1200 X 900 pixels or whatever), and then write code to manage what happens to each control given a clientsize change that is
    larger than your original template.
    I have provided a working example of this in this thread - https://social.msdn.microsoft.com/Forums/vstudio/en-US/228eef7f-f056-4a7d-836b-1f8ad99f21c8/windows-form-application-using-vbnet-maximizing-and-minizing-the-windows-forms?forum=vbgeneral
    It is only a simple example - try it, and see how I have dealt with resizing and windowstate changes. Looking at your screenshot above, I can see how each of your groupboxes and all your controls could be managed by you writing code to manage them.
    Leon Stanley - ♪Don't pay the ferryman - till he gets you over to the other side♪ . um . I apply this to corporations - not to God.

  • Having trouble with iphone and ipad syncing

    Just got my iphone. Trying to get music on it. Only problem is that my daughter has an ipad that wants to sync all of her apps on to my iphone. the music is ok because its in a playlist. The apps try to sync even though I have checked it to not sync the apps. Dont know how to seperate the two different itunes. Also having trouble getting itunes to recognize my card number to purchase music.

    Well, if "deleted the account" actually means simply removed using that account on the iPad, and if the account turns out to be an iCloud account, then you would have no problem.
    Simply go to Settings > iCloud on your iPad and turn on Notes.
    But you've given us so little information (e.g., was your account in iCloud?  Dles "deleted" actually simply mean removed from iPad?) that it's hard to tell if this would actually solve your particular issue.

Maybe you are looking for

  • Don't even have the choice to rebuild library

    I installed iLife 09 and with that, iPhoto. It was fine for a few days. Then, on Feb 8, after 6 days, when trying to import photos from a camera, the beach ball appeared and stayed there. I had to force quit. Tried another time. Same thing. I am usin

  • First attempt at php

    I also posted this in the General discussion forum for DW, as I was not sure where it will be picked up. I have just uploaded my first PHP script. This file should display a form to enable data input but the code is displayed instead, I cannot figure

  • Pricing Atrributes in Oracle HTML Quoting

    Hi, I have to price some items using Pricing context and attribute. As per my understanding, Pricing attributes are supported in form based quoting and not in HTML quoting. Please help me in undestanding, how to use attributes in HTML quoting. Thanks

  • List command.

    I want to know if it is possible to re-direct the output of the list command in rman to an external file. reason beeing that in rman, when ai issue the command rman> list backup summary, I get a hell of infos (as mai db is arround 1.2T and we have ap

  • Relation between Application and Data Group

    Hello All, Can someone please help me to get a query which tells me which Application is associated with which Data Group? Thanks, Moore


HashFlare