How to set foreground gradent color to label???

using this i can set background gradentcolor to label. But how to set foreground gradentcolor to label???
JLabel compname = new JLabel("ARDENT TECHNOLOGIES INC")
          protected void paintComponent(Graphics g)
            { int width = getWidth();
            int height = getHeight();
            GradientPaint paint = new GradientPaint(0, 0,  Color.blue, width, height, Color.green);
            Graphics2D g2d =(Graphics2D)g;
            g2d.setPaint(paint);
            g2d.fillRect(0, 0, width,height);           
            super.paintComponent(g); } };
            compname.setOpaque( false );Thanks in advance
raja

reply #3 looks interesting
http://forum.java.sun.com/thread.jspa?forumID=257&threadID=481290

Similar Messages

  • How to set a HTML color to a control button

    How to set a fixed color to a disabled button?
    I have a boolean button which has 3 status: on, off and disabled. I don't like the 'grayed and disabled' option. I will use red for off, green for on, and white gray (foreground color) for the disabled status. The HTML color code is BDBDBD. I tried to send the hex number 'BDBDBD' to the button property node 'color[4]' but was told that I was wiring to the wrong type of terminal.
    Could any one post a sample code of how to construct the structure of 'color[4]' using a RRGGBB number?
    Thanks,
    Ryan

    What exectly do you want and do you see.
    If I run the code you have in LabVIEW 9.0, I get the following result after running.
    For convenience I have shown the second color array you set as color indicators:
    Note that you use grey as the colors for True and False
    Here I have set made the colors more distinct:
    Ton
    Message Edited by TCPlomp on 07-10-2009 08:00 AM
    Message Edited by TCPlomp on 07-10-2009 08:01 AM
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!
    Attachments:
    ButtonColor_FP.png ‏17 KB
    ButtonColorMoreColor_FP.png ‏18 KB

  • 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 dash line color(two colors)?

    hello all:
    Does anyone know how to set dash line color in java?
    I only know how to set line color with a single color.
    g2.setColor(Color.black);
    g2.setStroke(dashed);
    g2.draw(new Rectangle2D.Double(50, 50, 200,100));
    what I need to implement is two colors interleave on the dash line.
    so that dash line looks like this:
    ==== ====
    red white red white
    thank you for any comments.
    -Daniel.

    create 2 strokes, space them appropriately, draw the rectangle twice.

  • How to set the Font size of Label?????

    Hello everyone.
    I want to knoe how to set the Font size of the Label???
    Please help..
    Thanks a lot.
    Gloria

    Label myLabel = new Label("Hello World");
    //Font(String name, int style, int size)
    myLabel.setFont(new Font("Arial", Font.PLAIN, 12));

  • How to set a background color to view

    Hi All,
              i creared a view with 2 textboxes and a button.These elements are in TransparentContainer.I set the background color to the TransparentContainer.By setting color to the TransparentContainer it is comming at the center and the 4 sides of it is displaying in the normal background color of the browser
    i didnt find any color options for the view called RootUIElementContainer.the width and height of the view are setted to the browser means 1024*768.
    Just like sap editor which we get by the link https://www.sdn.sap.com i want to get my view .....
    I want to set color to this RootUIElementContainer element which effect the whole view...not the containers or groups which i add under this RootUIElementContainer
    Regards
    Padma N

    hi Padma,
    For changing the background colour you will have to make the change in the theme.
    You can download the theme editor plugin for eclipse from SDN. With this plugin, you can make changes to the default themes , save as a new theme
    Or if you are using portal, then goto system administrator, theme editor, select SAP Streamline and change the color in Screen areas -> application, then save the theme with different name.
    Best regards,
    Sangeeta

  • 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

  • Setting foreground font color on a JSpinner

    I'm trying to edit the foreground font color on a JSpinner component.
    spinner.setForeground(Color color) or
    spinner.getEditor().setForeground(Color color) doesn't work
    What does?
    Best regards,
    Helge Fredriksen

    try:
          JSpinner.DefaultEditor editor=(JSpinner.DefaultEditor)spinner.getEditor();
          JFormattedTextField TF=(JFormattedTextField)editor.getTextField();
          TF.setForeground(myColor);;o)
    V.V.

  • How to set selected text color in Spark TextInput

    I'm trying to make Spark TextInputs and MXFTETextInputs look like Halo/MX TextInputs as much as possible, since I have a mix of both Spark and MX TextInputs in my application. I know I can set the
    selection background color to black using focusedTextSelectionColor. How can I set the selected text color to white so it matches the MX white-on-black look?

    This works, if you set the enabled property directly on the s:TextInput:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx">
        <s:layout>
            <s:VerticalLayout horizontalAlign="center" verticalAlign="middle" />
        </s:layout>
        <s:controlBarContent>
            <s:CheckBox id="ch" label="enabled" selected="true" />
        </s:controlBarContent>
        <fx:Style>
            @namespace s "library://ns.adobe.com/flex/spark";
            @namespace mx "library://ns.adobe.com/flex/mx";
            s|TextInput:disabled {
                color: red;
        </fx:Style>
        <s:Group>
            <s:TextInput id="ti" text="The quick brown fox jumps over the lazy dog" enabled="{ch.selected}" />
        </s:Group>
    </s:Application>
    It can get a bit trickier when you're setting the enabled property on a parent container, since (I believe) that the child control's enabled properties are still set to true and just the container is disabled. One possible workaround would be to bind the child TextInput control's enabled property to the container's enabled property. That way the s:TextInput should still go to it's disabled state and you can customize the disabled state's styles to have darker text, or whatever else you want.
    <s:Group id="gr" enabled="{ch.selected}">
        <s:TextInput id="ti" text="The quick brown fox jumps over the lazy dog" enabled="{gr.enabled}" />
    </s:Group>
    Peter

  • How to set image background color ?

    Hi All,
    In my project i have image,and if image have black spot or any unwanted spot then i will select that area and say clear it then it will remove that spot and set color of that area similar to area around that spot.
    I have written code for getting pixel color of selected area in image like this
    BufferedImage old_image = ImageIO.read(new File(myFile));
    int[] pixels = new_image.getRGB(0, 0,new_image.getWidth(), new_image.getHeight(),null, 0, new_image.getWidth());
    for (int i = 0; i < pixels.length; i++) {
    Color pixelColor = new Color(pixels);
    System.out.println("RGB ::"+pixelColor.getRGB());
    RGB returning negative value;
    Please tell me correct way how can i do this.
    It's very urgent.
    Thanks in advance.
    Thanks
    AP.

    i found the browser fill button.  Now how do I fill the browser fill with an image?

  • How to set default font color in Pages

    I don't know why. I did a standard clean install of iWork 08. In Pages, everytime I select to insert a text box, the color of the font defaults to brown rather than black. It's a pain to change it to black all the time. Also I noticed that when I select to insert a line, it also defaults to brown. Any thoughts on why this is happening as the default color and how to fix it?
    Also, almost evertime I do the option click on the text box icon to draw a text box, the cursor changes to the crosshair but the box allows me to draw the with size, but the length of the column automatically can't be drawn- it extends instead all the way off the bottom of the page. In other words I can't really draw the text box to the size I need. I'm new to Pages.

    Fix Your Fonts in Safari 6
    Some Safari 6 stuff
    TextExpander shell script snippet to set Safari 6 default fonts
    Safari 6 on Lion, text much smaller?
    Quickstyle - Canisbos
    Safari 6 default font way too small?

  • For P.O.D. Printing: How to Set Adobe RGB Color Space

    Hello and thanks in advance,
    (I'm using InDesign CS 5.5 on a Mac.)
    I need to set the proper PDF export settings
    For printing a book on demand, with color drawings inside on the text pages.
    The onnly instructions that I have been able to find, say this:
    "Submit your graphics in the Adobe RGB color space, withprofile embedded."
    The Big Question: How do I do that ?
    I know enough to start with
    File --> Adobe PDF Presets --> Press Quality
    Then I click on the "Output Menu"
    and here's where I start to get lost.
    for
    Color Conversion ...
    I think I should select "Convert to Destination"
    for
    Destination
    I think it should be "Adobe RGB (1998)"
    Now in order to embed this profile,
    What should I select under:
    Profile Inclusion Policy   ?
    And is there anything else I should be doing to get these inside color images printing nicely ?
    Thanks again,
    IthacaAuthor (aka ZorbaTheGeek, but the forum would not let me log in with my old screen name)

    Virtually all digital printing is done via either PostScript or PDF. In the former case, the PDF is converted to PostScript viat use of Acrobat and in the latter case, the PDF is sent directly to the digital printer.
    In either case, CMYK is in fact the actual destination color space. There are no real RGB printers!!! What is true is that non-PostScript / non-PDF printers (typically low end laser and inkjet printers as well as specialized inkjet and dye sublimation photo printers) do take in RGB via drivers and convert that to CMYK, but I don't believe that is what you are dealing with.
    Our recommendation at Adobe for best printing results, whether for offset or digital printing, is to export PDF as PDF/X-4 with no color conversion using the default CMYK color space (SWOP CMYK) or if instructed otherwise by your print service provider, one of the other CMYK color spaces provided by Adobe or by the print service provider themselves. FWIW, most on-demand digital print devices do have settings to fully emulate SWOP CMYK printing conditions. Using PDF/X-4 in this manner allows the existing color content in your InDesign document to be properly tagged in the output PDF file and converted to CMYK at the digital printing device's RIP.
    (It might also assist us if you can provide a pointer to the explicit instructions provided by your print service provider.)
              - Dov

  • How to set table alternating color

    how do i set the properties of table with alternating color
    properties :
    design : alternating  
    it is like normal table , although i have change the properties of design to alternating.....
    pls advice

    Hi Yzme,
    When you change the Table Design propety to "<b>alternate</b>", change the <b>readOnly </b>property to <b>"true</b>". Then the table will display the alternate colors but the table will be read only.
    Refer to the following thread also:
    Re: Problem with table design in 2004s
    Regards,
    Jhansi

  • 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

  • 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

Maybe you are looking for

  • Need to import VIDEO_TS into iMovie and I cant do it.

    I have several discs with clips on them that I need to import into iMovie to edit all together, I can not seem to do it. On one disc for example is a Video_ts folder and in the file are .bup .ifo .vob I dont know if these are the clips, if so how do

  • Ipod Touch Gen 2 App Update Issue :(

    Hi, I have an iPod Touch gen 2, recently it has stopped updating my apps. When I click on "update," it will ask me for my password, the it'll say "waiting" with the little bar, then the icon will return to normal, but no update has taken place and th

  • Transferring the negative sign from Right to Left for a currency field.

    Hi All, I am trying to transfer the negative sign in a currency field from right to left but in doing that i am not getting the comma seperators of the currency field. For eg : If the value is 12,345,678.00- then after converting it i am getting it a

  • Shared Lock

    I am using a customized screen to upload a material. How to perform a shared lock... for eg., if a user is editing a particular material(m100) then if any other user tries to edit the same material, he should not be able to edit... he should be able

  • Windows 7 needs about 10 minutes to start

    @20.93.53.