JTree how to use different font's color for different node

Hi all
This is the first time I am using JTree in my application and I have got some problems with it that I can't work out after reading the Java tutorial. Please help!
1. For some nodes, the font color need to be different.
2. One node need to use more than one font type for example "This is a sample " some words need to be bolded.
Kind regards
Edmond

Did you read the section on [url http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html#display]Customizing a Tree's Display?
And did you follow the link on renderers?

Similar Messages

  • How to use decode to calculate sum for different date range

    I'm stuck with decode() function:
    I have a table like this:
    (project_id, approve_date, value, builder_code)
    I want to write a SQL query to get sum of values for different month of the approve_date, and group by builder_code)
    The result is like this:
    builder_code Sum(value)_Sep-03 Sum(value)_Oct-03 Sum(value)_Nov03
    1001 1,299 1,322 990
    1002 3,332 1,222 333
    I tried to use decode for this question but could not get the answer.
    Thanks a lot

    I don't think you need a DECODE() here. I'd do something like this-
    create table builder (
        project_id number,
        approve_date date,
        value        number,
        builder_code number
    insert into builder values( 1, to_date('09-01-2003', 'MM-DD-YYYY'), 100, 990 )
    insert into builder values( 2, to_date('09-03-2003', 'MM-DD-YYYY'), 150, 990 )
    insert into builder values( 3, to_date('09-05-2003', 'MM-DD-YYYY'), 250, 990 )
    insert into builder values( 3, to_date('09-05-2003', 'MM-DD-YYYY'), 250, 333)
    SELECT sept.builder_code, sept.sept_sum, oct.oct_sum
    FROM (SELECT builder_code, sum(value) sept_sum
            FROM builder
           WHERE approve_date >= to_date('09-01-2003','MM-DD-YYYY')
             AND approve_date < to_date('10-01-2003','MM-DD-YYYY')
           GROUP BY builder_code) sept,
         (SELECT builder_code, sum(value) oct_sum
            FROM builder
           WHERE approve_date >= to_date('10-01-2003','MM-DD-YYYY')
             AND approve_date < to_date('11-01-2003','MM-DD-YYYY')
           GROUP BY builder_code) oct
    WHERE oct.builder_code(+) = sept.builder_code
    BUILDER_CODE   SEPT_SUM    OCT_SUM
             333        250
             990        500Justin
    Distributed Database Consulting, Inc.
    www.ddbcinc.com/askDDBC

  • How to use dbo procedure to execute for different schema?

    I am using SQL Server 2008 R2, I have a schema [dbo],
    and in that schema, I have created a stored procedure dbo.GetAccount:
    CREATE PROCEDURE dbo.GetAccount
    AS
    BEGIN
    select * from tblAccountNet
    END
    GO
    Then, I have created a schema [ABC] with
    user named UserABC.
    Now, I would like to login with UserABC and
    execute dbo.GetAccount for
    schema [ABC] to
    get all user of it and don't want to change code of dbo.GetAccount.
    So, how can I do?
    Thanks for your help.

    Thank you everyone.
    But, I don't want to change procedure dbo.GetAccount because in face, I have more 100 procedures. I think of two solutions:
    1. Create another stored procedure in
    [dbo] schema, and use it to read all other procedure to list all table used in procedure and assign them with schema
    [ABC]
    2. Create
    a stored procedure to change schema of all table in every procedure
    But I really don't know how to do it. Please help me.
    Thanks so much.

  • How to use Purch. Info Record, for different Valuation Types ?

    Hi All,
    While doing Split Valuation,
    I have created three valuation types - say,  M1,M2,M3. for material M.
    Now, I want to create Info record for material M and Vendor V1.
    when i go to me11, system is allowing me to create info record for M and V1 once only,
    in Purchasing Organization View, I'm getting the Valuation type field,
    but can't entering 3 prices for 3 valuation types,
    such as in Material Master.
    Can any one help me regarding this....
    Thanks,
    Anand.

    if u create po with info update indicator then u can use your valuatiion type in po for whihc there is no ifo recrod existing then system willl createt one
    but actually the price will get stored in the price oder history not exactly in the pir

  • How to use the XPath's "preceding" for upper nodes?

    I need to display the filed <?LOC?> only if it's different from the previous one. The following works:
    <?LOC[not(.=preceding::[b]LOC)]?>
    However, if the field is pulled from the upper node, like <?../../LOC?>, the following does not work:
    <?../../LOC[not(.=preceding::[b]../../LOC)]?>
    What would be the correct syntax in this case?

    OK..
    Here is XML:
    <LOC_TEST>
    <CNTR>
    <COUNTRY>UK</COUNTRY>
    <LOCT>
    <LOC>EDI</LOC>
    </LOCT>
    <LOCT>
    <LOC>LON</LOC>
    </LOCT>
    </CNTR>
    <CNTR>
    <COUNTRY>US</COUNTRY>
    <LOCT>
    <LOC>BOS</LOC>
    </LOCT>
    <LOCT>
    <LOC>NYC</LOC>
    </LOCT>
    </CNTR>
    </LOC_TEST>
    Here is RDF:
    <?for-each:LOCT?>
    <?LOC?> <?../COUNTRY?>
    <?end for-each?>
    Here is output:
    EDI UK
    LON UK
    BOS US
    NYC US
    ...and I need this:
    EDI UK
    LON
    BOS US
    NYC

  • Can I show different fonts and colors text on 1 multi-line text fields?

    I want to format different messages on 1 mutli-line field with different fonts and colors for the heading lines. Can I do that in Forms 6i ?

    You must use in trigger Post-query the sentence:
    Example:
    DECLARE
    cur_itm VARCHAR2(80);
    cur_block VARCHAR2(80) := :System.Cursor_Block;
    BEGIN
    cur_itm := Get_Block_Property( cur_block, FIRST_ITEM );
    WHILE ( cur_itm IS NOT NULL ) LOOP
    cur_itm := cur_block||'.'||cur_itm;
    Set_Item_Instance_Property( cur_itm, CURRENT_RECORD,
    VISUAL_ATTRIBUTE,'My_Favorite_Named_Attribute');
    cur_itm := Get_Item_Property( cur_itm, NEXTITEM );
    END LOOP;
    END;

  • Unable to send mail with different fonts and colors

    Hi All,
    here is the explanation for my problem:
    I am sending mail using javamail. when i send the text with different font and color its not received in the same way. it is simply sending as plain text.
    Please help me on this issue.
    Thanks
    NG

    Hello,
    I am trying to develop an email application. It consists on sending email from [email protected] to [email protected]
    How can I do this in java ?
    I am using this software but it works only with gmail !!
             * Send Email to the webmaster
             String  d_email = "[email protected]",
                     d_host = "smtp.gmail.com",
                     d_port  = "465",
                     m_to = "[email protected]",
                     m_subject = "Email from user";
             Properties props = new Properties();
             props.put("mail.smtp.user", d_email);
             props.put("mail.smtp.host", d_host);
             props.put("mail.smtp.port", d_port);
             props.put("mail.smtp.starttls.enable","true");
             props.put("mail.smtp.auth", "true");
             props.put("mail.smtp.debug", "true");
             props.put("mail.smtp.socketFactory.port", d_port);
             props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
             props.put("mail.smtp.socketFactory.fallback", "false");
             SecurityManager security = System.getSecurityManager();
             try
                Authenticator auth = new SMTPAuthenticator();
                Session session = Session.getInstance(props, auth);
                //session.setDebug(true);
                MimeMessage msg = new MimeMessage(session);
                msg.setText("This is a message from: "+UserEmail+"\n "+UserMessage);
                msg.setSubject(m_subject);
                msg.setFrom(new InternetAddress(d_email));
                msg.setSentDate(new Date());
                msg.addRecipient(Message.RecipientType.TO, new InternetAddress(m_to));
                Transport.send(msg);
             catch (Exception ex)
                ex.printStackTrace();
                out.println("Messaging ERROR: " + ex);
                out.println(stack2string(ex));
                    if(ex.getMessage().compareTo("")!=0)
                        check = "Message NOT SENT " + ex.getMessage();
        private class SMTPAuthenticator extends javax.mail.Authenticator
            public PasswordAuthentication getPasswordAuthentication()
                return
    new PasswordAuthentication("[email protected]", "pwd");
        }please advice

  • How do I change font and colors back to default?

    I have changed the font and color of the text through the tools button and the options button and the content tab. I find nothing telling me how to change the font and colors back to default font and colors. Can you advise me? I'm using Windows 7 Home Premium OS. Thanks.

    Hi Brenda19605,
    You can use this article to set the fonts and colors: https://support.mozilla.org/en-US/kb/change-fonts-and-colors-websites-use?esab=a&s=font&r=0&as=s
    The default settings for the font are in this article:
    https://support.mozilla.org/en-US/kb/Some%20text%20shows%20up%20bold%20after%20upgrade
    Unfortunately for the default colors has no good reference. But for text it is black (most lower left) color, background is white (most upper left color). Unvisited links is blue (column 8, row 5) and visited link is purple (column 9, row 5).
    Let me know if you need anymore help!
    Lordfreak

  • How to define the same font size,color for a text field label

    hi all,
    In my project i need to define the same font size & color for all the text field lables in the application.how do we can achieve this?
    Thanks & regards,

    ...or you could use declarative components....
    Not sure if skinning would prevent developers from overriding a look and feel??? hmmm not sure..
    Grant

  • How to use the same OC4j server with different port number

    How to use the same OC4j server with different port numbers..?
    I have to OC4J installed on my machine on different hard disk drives....
    I want to be able to run both the server simultaneously..?
    is it possible ..it yes then how..?
    for that i have changed the port number of one server...
    but when i am trying to start the other server with different port number..it says that JVM -Bind already...
    Is there any clues...?
    Nilesh G

    In the config directory:
    default-web-site.xml: Change the port the HTTP listener listens on
    jms.xml: Change the port the JMS service listens on
    rmi.xml: Change the port the ORMI listener listens on.
    Or, you can add another web-site.xml file, and deploy your applications to 1 server, and bind the web applications to the different web sites. This way you only have to deploy your applications to 1 place.
    Rob
    Oracle

  • How to use unicode fonts in Oracle forms 10g?

    Hi I am working in forms 10g for quite a long time, the software that I have developed so far are all in English language. Now I have requirements to use Bengali Fonts in Forms 10g. I am facing difficulties doing that. Please reply with help. Thanks
    Hasan Al Mamun

    Check this forum post (though that is for 6i, it would be of helpful for you)
    How to use unicode fonts in Oracle forms 10g?
    -Arun

  • How to use MICR fonts in Adobe forms (webdynpro java

    Hi,
          We have a requirement where we need to print some MICR codes (for checks) through Adobe Forms.
    I have installed some true type MICR fonts in windows and Adobe Font Manager (in ADS) as well.
    It is visible in the Adobe Form design time (Font palette) and when I use the font for text, it is visible in preview too. But when I run the web dynpro application, in the online form it is converted into Standard font (Times new Roman).
    Is there anyway to handle this issue.
    Please let me know.
    I am using NWDS 7.0.1
    Adobe Live cycle designer 7.1
    SAP NW 2004s SP14
    Thank you,
    Vasu

    Check this forum post (though that is for 6i, it would be of helpful for you)
    How to use unicode fonts in Oracle forms 10g?
    -Arun

  • How to use Google Fonts in email?

    Hi,
    I would like to know how I use google fonts in my emails.
    We're using the ubuntu font and I see the fonts on my computer but after sending an email the fonts change.
    I'm using the addon SmartTemplate4.
    Hope any f you know the answer!
    Thanks in advance

    Several online resources point to these two articles at Campaign Monitor:
    * [https://www.campaignmonitor.com/blog/post/3897/using-web-fonts-in-email Using web fonts in email] (Dec. 2012)
    * [https://www.campaignmonitor.com/resources/will-it-work/webfonts/ Web Fonts] (permanent resource)
    The first link provides examples on how to do this, while the second one has informaiton about email client support & compatibility with this feature.
    Keep in mind using web fonts will have a limited effect if viewing such emails while offline.
    [http://kb.mozillazine.org/Default_HTML_font_for_new_messages_-_Thunderbird This older MozillaZine article] also has information about fonts use in Thunderbird. In my experience in most cases the receiving party will have to have the fonts locally installed for the best results.

  • How to use unicode font in J2ME

    Hi,
    I want to create some mobile application using Unicode Font in J2ME.
    Please help me about how to use Unicode Font in J2ME and how to configure Unicode Font in J2ME SDK 3.0 Early Access

    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=2&t=001235
    http://www.linuxforum.net/chinese/develop/java.html
    Hope its of help to you.

  • HOW TO: using custom fonts in native storyboard views from an ANE on iOS

    Hey,
      In our apps, we have embedded storyboards into an ANE, and successfully used those screens in an AIR app, and figured out how to use custom fonts in those views.
      I wrote a quick blog post about it and just thought I'd share it real quick in case it helps someone.
    ANE for iOS with Custom Framework – Using Custom Fonts | khef.co

    Hi WayHsieh,
    >>can I just "install" fonts through Word App? Does Word Apps have enough privilege to install fonts on Windows? Can I just click a button in Word App, and then it will install fonts automatically?<<
    Based on my understanding, it is hard to achieve the goal. Because the app webpage is hosted inside an Internet Explorer control which, in turn, is hosted inside an app runtime process that provides security and performance isolation and it is under
    low-Integrity level.
    Here is the figure for apps for Office runtime environment in Windows-based desktop and tablet clients:
    You can get more detail about Privacy and security from links below:
    Privacy and security for apps for Office
    Hope it is helpful.
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • Raid0 Btrfs grub boot experiments full size devices (See Edits)

    The following source has detailed info on a method to utilize grub2 in arch raid bootable installs: http://travishegner.com/2012/02/boot-ar … 42AA7OVv3T My utilization involves Compact Flash devices in raid0 and was successfully used to install the l

  • IMac, Multiple Monitors & Spaces

    I have 2 monitors connected to my new iMac.  I arrange various setups using Spaces on all 3 monitors.  When the iMac comes out of sleep mode, all of the panels are always pulled into the iMac monitor (e.g. the other monitors are empty) in each Space.

  • Black iPad with Retina Display Help

    When I watch videos I downloaded in full screen, the screen gets very light and bright. Why does it do that?

  • Unable enter recovery mode: Error 3F0

    HP ENVY DV7T-7200 Windows 8 64-bit Hi: I just got the laptop above on Friday from my cousin (who wanted something MORE when this is an amazing computer as it is but I digress)... But since I didn't want his user files, name and software on there, I t

  • Selecting a group of files and putting them in a newly created folder?

    If I select a group of files in finder or on my desktop -- is there a command to create a new folder and put them in it? (I'm thinking of how you can take a selection in iTUNES and create a playlist from the selection). (I know how to create a folder