How to set the display color of string?

I want to display several lines of text string with different colors. Does anybody know how to do that?
a simple example would be great.
thanks in advance

depends on how you go about it ...
if you use labels you can use the labels setForeground(Color c); method.
you also do this in the paint() method,
using setPaint() , and the drawString() method og Graphics instance

Similar Messages

  • How 2 set the background color in j2me

    Can any body tell me how to set the background color to midlet.??

    if you are using Screen then you can call its setBackColor()
    or if you are using Canvas then you can call
    g.setColor(r,g,b);
    g.fillRect(0,0,getWidth,getHieght);
    where g is the Graphics instance of Canvas,for further information consult documentation

  • How to set the Background Color of a Text Field in a Tabular Report.

    Hello,
    I tried to set the Background Color of a Text Field in a Tabular Report.
    But I was not able to change this colur.
    In the report attributes --> column attributes
    I tried already:
    1. Column Formating -- >CSS Style (bgcolor: red)
    2. Tabular Form Element --> Element Attributes (bgcolor: red)
    but nothing worked.
    Can anybody help me?
    I Use Oracle Apex 2.2.1 on 10gR2
    thank you in advance.
    Oliver

    in "Report Attributes" select the column to move to the "Column Attributes" page. In the "Element Attributes" field under the "Tabular Form Element" region enter
    style="background-color:red;"
    I will also check if there is a way to do this via the template and post here again
    edit:
    in your template definition, above the template, enter the following:
    < STYLE TYPE="text/css" >
    .class INPUT {background-color:red;}
    < /STYLE >
    (remove the spaces after the < and before the >)
    change "class" to the class that the template is calling
    (I'm using theme 9, the table has: class="t9GCCReportsStyle1" so I would enter t9GCCReportsStyle1)
    A side-effect of using this second version is that ALL input types will have a red background color--checkboxes, input boxes, etc.
    Message was edited by:
    TheJosh

  • How to set the display size of the PDF - in percent?

    Hi, I wonder if anyone knows if it is possible to set
    the display size of the PDF document, so that it always
    shows in, let´s say 100%, in the viewers browser window?
    Much grateful for any help!
    /Anni

    In Acrobat, under Document Properties (Ctrl+D), you can edit the Initial
    View settings, including the zoom level.

  • How to set the DISPLAY variable to run admsi.pl?

    Dear Experts,
    I'm trying to patch Oracle apps R12 using admsi.pl.
    hostname: black
    APPS db: VIS
    But I keep getting the error:
    Please set the DISPLAY variable and re-run this script
    This is what I did:
    VIS database and listener are already running.
    login to the linux server as unix user: applmgr
    cd /oapps/applmgr/VIS/apps/apps_st/appl/
    . APPSVIS_black.env
    cd /oapps/applmgr/VIS/apps/apps_st/appl/ad/12.0.0/bin/
    admsi.pl
    Invoking Oracle Patch Application Assistant....
    Please set the DISPLAY variable and re-run this script
    huh ?
    set | grep -i "display"
    DISPLAY=:0.0
    set | wc
    435 486 25235
    I notice that there are 36 .env files!
    For applmgr alone!!
    find /oapps/applmgr/ -type f -name "*.env" | wc
    36 36 2626
    For oracle, there are another 7 .env files!
    find /oapps/oracle/ -type f -name "*.env" | wc
    7 7 513
    Did I get the environment (env) file correct?
    Or do I need to run a few more env first?
    If so, which ones?
    What would the order of operations be?
    sqldeveloper has given me problems with Display sometimes.
    But even sqldeveloper works fine.
    What is the secret to get admsi.pl to run in the normal manner?
    Thank a lot!

    Thanks a lot, that worked! So the perl script was wrong.
    In the meantime, I had done this, and it seemed to work:
    admsi.pl -debug
    Gathering Information..
    Enter the patch_top : /oappsinstall/update12.1.1/7303030
    Enter the APPS user password:
    Logfile for this session is located at admsi.log
    Generating installation instructions for patch 7303030..
    Updating database....
    install_7303030.html generated successfully
    install_7303030.txt generated successfully
    cat /oapps/applmgr/VIS/apps/apps_st/appl/ad/12.0.0/bin/admsi.log
    Executing begin :value := ad_manual_step_object.is_step_already_done('per_hrglobal','120.2.12010000.1'); end;
    Generating installation instructions for patch 7303030..
    Updating database....
    install_7303030.html generated successfully
    install_7303030.txt generated successfully
    Performing final cleanup..
    Do you think this worked ok?
    Thanks again!

  • How to set the text color in a Canvas?

    When I use (Graphics) g.setColor(255,255,255), then g.drawString("xxx", 0, 0, ....);
    the simulator works well but it can't work in my mobile phone (Nokia 7650).
    What's wrong?
    Thanks.

    do it like this
    g.setColor(255,255,255);//this will set the color for the canvas
    g.fillRect(0,0,ht,wd);//this will fill the rect(screen) with the above color,actually this will be BG color for ur app..ht,wd are the height and width of ur canvas...
    now specify color for the text
    g.setColor(r,g,b);//this color shud ofcourse be diff frm the color set for BG
    now draw the string
    g.drawString("xxx", 0, 0, ....);

  • How to set the (specific) color for a Chart Series in a Flash Diagramm

    Hello all,
    I wonder how I can set the color (of a bar) for a Chart Series in a Flash Diagramm.
    So far I found now set-screw for this.
    Can someone give me a hint please.
    Thanks in advance.
    Andre

    Hi,
    On the Chart Attributes page for the region, change the "Color Scheme" setting to Custom. Then, in the "Custom Colors" setting, enter the colours you want for all series, separated by a comma. For example:
    red,yellow,greenAndy

  • How to set the default Color Picker?

    Hello everyone,
    I wrote my own Color Picker and it works nicely within the standard apple color picker panel. I am quite annoyed, however, that I have to switch to my new Color Picker by hand every time I open the Color Picker Panel. I have found that I can set an application-speficic default color picker by setting the NSColorPickerSlidersDefaults property for that application using defaults. However, that way I can only set one of the original apple color pickers to be the default, not my own, because there is no number defined for my own color picker and I can't add it.
    Does anyone know a solution please?

    Thanks camickr !
    That's exactly what I was looking for. (let the UIManager take care of colors of the textfield whether it's editable or not)
    as for 2nd reply my code is in several files. IF i have to shorten it, it would be:
    it's just a pseudo code and incomplete but it gets the idea across
    * this function automatically changes colors of textfield based on mode which can change any time
    if(mode == NEW_MODE)
    textField.setEditable(true);
    else
    textField.setEditable(false);
    * This function sets the color during save time
    public void save()
    clear();
    if(textField.getText() == null)
    textField.setBackGround(Color.PINK);
    public void clear()
    //reset the color if it's pink or to the original color
    //the color must update once we change mode which is independent of this
    public void open(Patient p)
           clear();
           displayPatient(p);
    }

  • How to set the display ratio of master and detail view

    Currently, I use SplitApp that contain the master and detail view. And I would like to show the master view on the left half and detail view on the right half. Is there any proper way to adjust this?
    Thank you in advance.

    You can set the width ratio by adding css. Check this,
    http://jsbin.com/dakir/1

  • How to set the "display name" of an customized property

    Hi,
    I've created a customzied property of KM file with KM API, and display it in KM navigation iview. It is ok, except the Column head show the technical name of the property. But what i want is some specify display name and even can support multi language, how this can be done?? Any hint?? Thanks!!
    Best Regards,
    Xiaoming Yang

    you must change the collection render and the resource render in order to show the properties you want.
    For translation propourses check this link
    http://help.sap.com/saphelp_nw04/helpdata/en/75/e000861cb8ad4b8e4f19dd6416346d/frameset.htm
    You must deal with resource bundle

  • How to set the display value of subtotal

    Hi,
    I'd like to ask a problem,
    I'm using BIEE11.1.1.6, I created a table in BIP layout,there are 3 column,
    YEAR-------COMPANY----------SALES
    2009--------A----------------------100
    2009--------B----------------------100
    2010--------A----------------------100
    2010--------B----------------------100
    2010--------C----------------------100
    I want to add a subtotal row,like
    YEAR-------COMPANY----------SALES
    2009--------A----------------------100
    2009--------B----------------------100
    2009 total------------------------200
    2010--------A----------------------100
    2010--------B----------------------100
    2010--------C----------------------100
    2010 total------------------------300
    by default, it is
    YEAR-------COMPANY----------SALES
    2009--------A----------------------100
    2009--------B----------------------100
    ---------------------------------------200
    2010--------A----------------------100
    2010--------B----------------------100
    2010--------C----------------------100
    ---------------------------------------300
    how can it show the YEAR value||' total' ? like showing '2009 total'?
    thank you!

    Hi Christian,
    Have a look at this thread Re: Default the Date Picker to Today
    It covers this issue in detail.
    Regards
    Paul

  • How do I set the background color of a page_item?

    I've been pasting "background-color:#5CD65C" in a number of places, like "HTML Table Cell Attributes" under the Label and the Element tabs, but get no results. Can anyone tell me how to set the background color of a cell, please?

    Hi Doug,
    Dynamic Actions is an alternative also, especially if it is conditional.
    Action Set Style
    Fire When Event Result Is True
    Style Name background-color
    Value #5CD65C
    Selection Type DOM Object
    DOM Object your item name
    Set your Condition Type and you have it.
    Jeff
    Edited by: jwellsnh on May 24, 2011 3:55 PM

  • How can I set the background color of JLabel?

    Can any one tell me how to set the background color of a JLabel?
    I have:
    JLabel prop = new JLabel("blahblah");
    prop.setBackground(Color.red);
    Thank you in advance...

    JLabel prop = new JLabel("blahblah");
    prop.setBackground(Color.red);
    prop.setOpaque(true);

  • How can i set the alternating colors for a table rows

    Dear All,
    Please any one help me how can i set the Alternating colors for Table Rows.
    i created a theam there i set the background alternating color to brown and i set the table design properity to alternating. but it is not reflecting.

    Hi,
    The design property in Table properties should work for your requirement. Select "alternating" value for design.
    Please see the API below:
    design
    Determines the appearance of the table. The property design can take the following values and is represented by enumeration type WDTableDesign.
    alternating - The table rows are displayed alternately in a different color.
    standard - The table background has one color. The individual table rows are displayed with grid net lines.
    transparent - The table background is transparent. The individual table rows are displayed without grid net lines.
    Check whether you have changed the right property or not? Also table should contain more than one rows to test this scenario.
    Regards,
    Jaya.
    Edited by: VJR on Jun 17, 2009 6:43 PM

  • Can I invoke a SubVI in an event? and how do I set the background color of a pipe to #0000ff?

    When I click an image or a glass pipe(which belongs to Industry/Chesmitry category in palette), I want a SubVI to be invoked.
    The purpose is to fetch an OPC-UA data from a web service and to write to it via the service.
    We are building an HMI solution which displays an interactive water plant diagram.
    When users click pipes and motors in the diagram, clicked devices should be turned on and off and change their animations or colors accordingly.
    OPC-UA is for communication with devices.
    I couldn't even set the background color of a pipe to "#0000ff", but setting it to "Red" or "Blue" was possible, and I don't know how to invoke SubVIs in event scripts.
    The documentations in NI.com are confusing and lack depth.
    Even silverlight references are confusing.
    How do I do all of these?

    Hi iCat,
    Can you provide some more information about your current implementation so that we can help to answer your questions. Some questions I have for you are:
    Are you creating this project in the NI LabVIEW Web UI Builder or in LabVIEW?
    How are you publishing your webservice? Is this also in LabVIEW?
    How is your webservice interacting with an OPC-UA server?
    How is the certification set up with OPC-UA so that you can communicate between the server and the client?
    Best Regards,
    Allison M.
    Applications Engineer
    National Instruments
    ni.com/support

Maybe you are looking for

  • Append data from one table to another.

    Hi, I want to insert/append some or all the data from one table to another table. For eg: Data from table table1 to be appended to table2 with the same constraints, indexes etc. The columns are same for both the tables. I am using 10g version 2. Plea

  • Diagnostics Setup - Warning on Step "Wilyhost Agent Details"

    Hi All I am having a bit of dificulty configuring the Wily Agent via Solution Manager diagnostics. I am currently getting the following errors when trying to set up the Wilyhost Agent when I run the setup wizard I am getting the following results: Wi

  • Tree Label - verticalAlign??

    I've gone round and round with this tree component trying to get the labelField to verticalAlign to the middle and still I can't get it to stop aligning to the top. I would like help in figuring this out so that I may use bigger icons with my Tree co

  • Java.rmi.RemoteException - on deploying a webservice through NWDS.

    Hi All, We have created and successfully build a webservice application in NWDS. Now when the activity is activated in Activation view, the build goes fine but deployment gets aborted with the following error: Caught exception during application depl

  • SAPF150D-Dunning Notice Print - With Update of Line Items and Master Record

    When I am running this program SAPF150D(Dunning Notice Print - With Update of Line Items and Master Records) with a variant containing run date, runc id, update mode, pimmed & pcount; the job is failing to execute. It is giving message like, "The fie