Set font color for the JTextField

I'm using JTextField in my project. However, can anybody teach me how to set the font color for the font in the JTextField to other color. The default font color is black. Any idea about this?

JTextField field = new JTextField(20);
field.setForeground(Color.blue);
Good luck ;)

Similar Messages

  • Changing the font color for the complete row based on the Keyfigure Values

    Hi Experts,
    Can any one help me to find a solution for this?.
    I have a requirement, in which the Font color for the complete Row needs to be set to RED in Bex Report, when the corresponding Row Keyfigure is more than a particular value.
    Ex: Notification-Material-Customer-Def Qty-delivered Qty
          1000000 - XXXXX- AAAAAA-10-1000
    in the above example, when the Defect qty increses more than 10, then the complete Row Including the characterstics, Notification, Material, and customer Should be Highlighted in Red. This has to happen automatically once the Query is refreshed.
    Please let me know if you have any suggestion here?.
    Regard,
    Muruganand.K

    Hi,
    Step 1: Click the Format Menu in Excel(BEX Analyzer)
    Step 2: Click the Style submenu
    Step 3: there will be number of SAPBEX formats available. Each of these relates to another cell of BEx (Header, Cell Data,
                Result  Row, Hierarchies, etc.). Also, they depend on data types.
    Step 4: Select SAPBEXchatext
    Step 5: Click Modify. This displays all the standard formatting option as shown below.
    Step 6: Select Font, Color (Background/ Font).
    Step 7: Click OK on both the screens. The entire BEx output result row Font and color is modified.
    Hope it helps........
    Regards,
    Suman

  • How to automatically build a table with 2 alternated font colors for the lines ?

    Hi,
    I'm looking for a way to automatically build a table with alternate background color and alternate font color for the lines.
    I have this particular project (a list of companies of an industrial area) and it is updated twice a year :
    I managed to set an automated alternate background color of the lines so this works well (white/blue/white/blue...)
    But the font color does not automatically alternates... and I do not know how to set this up...
    All the companies are ordered alphabetically so when I have to insert or delete one, the whole text of the table under the modified line is messed up. Then I have unreadable white text on white background and blue text on blue background...
    Does anyone have an idea on how to automatically alternate the font color ?
    Thank you.
    Best regards,
    G.

    Hi,
    I know this [JS] code is awful but it works. If  someone wants to correct it …! 
    At the beginning, you have an Excel file. You play a little with it [doing concatenations] to get, after importing it in ID:
    Then, just run the .jsx:
    Done! 

  • WLC AireOS 8.0 - how to set font-color for integrated webauth/weblogin?

    Hello,
    up to AireOS 7.6 I was able to set the font-color of the internal webauth/weblogin page using html-codes, for example like this:
    Headline: Welcome to our <font color="red">guest</font>-network!
    Message: You need a valid <font color="blue">user</font> to login.
    Now with AireOS 8.0 this doesn't work anymore. When I try to set a headline or message with font-tags I get "Error while setting headline." (or "...message.") when I hit apply. I have to remove the font-tag to save the weblogin page.
    #CLIWEB-6-CLIWEB_INVALID_HTML_TAGS_USED: [PA] cli_web_api.c:1748 The Customization message field has invalid html tags
    #CLIWEB-6-CLIWEB_INVALID_HTML_TAGS_USED: [PA] cli_web_api.c:1663 The Headline field has invalid html tags
    So, how can we now set different font colors/styles like in previous releases? Using external or uploading selfmade pages is not an option.
    Thanks,
    Chris

    Since your using code to change the default internal portal page look, its better for you just to create a custom webauth and upload that to the WLC.  That is how I do my implementations as its easier for me to create a new page than trying to mess around with the internal page.  As you can see, Cisco can change the way things work in every version.  It might just be the fact that they no longer are allowing html code to be inserted in the default webauth/passthrough page.
    Scott

  • Setting Font/Color for ProgressMonitor

    Hi All,
    I am using ProgressMonitor something like this.
    pbar.setNote("Loading:"+f[index].getName()+ "  " +"with Operation of " + counter + "% complete");Where pbar is an instance of ProgressMonitor.Now we can see that setNote method inside ProgressMonitor String as an argument.I want to set the font and foreground color for the text inside.Any idea how to do that??
    Any help appreciated.
    Thanks in advance.
    regards,
    Viswanadh
    Edited by: TechnicalGuy7 on Apr 24, 2009 3:42 AM

    If the progress bar had a method to set a label, instead of just set text, then you could set that label with any font and colors that you wanted...
    If you really needed to set the font color, you would need to call setUI on the progress bar, and provide you own ProgressBarUI class.
    You could start with one of the UI classes provided, like BasicProgressBarUI and extend it and modify it as you wish.
    But this is really advanced...

  • Can I set a default font and font color for the text field properties?

    I am setting up applications, some of the information I fill in prior to sending it to the client; I would like that text to always be in a specific font and color so it is clear to the client what information I filled in for them when they are reviewing the document.
    Thank you

    Not at this time, but I've asked the product team to consider adding it as a feature. Thanks for the suggestion.

  • FF31: How can I set a color for the empty page opened by new tab ?

    Currently my new tabs open an empty, white colored page.
    Is it possible to give this page a color of my choosing, say sky blue ?
    If so, how ?

    Try:
    *Customize about:newtab: https://addons.mozilla.org/firefox/addon/customize-aboutnewtab/

  • How do you set the font color for a specific entire row inside a JTable?

    How do you set the font color for a specific entire row inside a JTable?
    I want to change the font color for only a couple of rows inside a JTable.
    I've seen some ways to possibly do this with an individual cell.
    Clarification on changing the font color in an individual cell would be helpful too if
    there is no easy way to do this for a row.

    hai,
    Try out with this piece of code.Create your table and assign the renderer to each column in the table.
    CellColorRenderer m_CellColorRenderer = new CellColorRenderer();
    for(int i=0;i<your_JTable.getColumnCount();i++)
    your_JTable.getColumnModel().getColumn(i).setCellRenderer(m_CellColorRenderer);
    class CellColorRenderer extends JLabel implements TableCellRenderer
    CellColorRenderer()     
    setOpaque(true);     
    setHorizontalAlignment(LEFT);
    setVerticalAlignment(CENTER);
    setBackground(Color.white);
    setForeground(Color.black);
    protected void setValue(Object value)
         setText((value == null) ? "" : value.toString());
    public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected, boolean hasFocus, int row,int column)
         if(isSelected == true)
              setForeground(Color.red);
         else
              setForeground(Color.black);
         setValue(value);
         return this;
    regards,
    bala

  • In Dreamweaver 6, I created a new fluid layout. I set up (4) DIVs. In the 3rd div, I changed the font color. The new color shows up on the website when viewed in my computer desktop, but, when viewed in a tablet and a cell phone, the color of the font doe

    In Dreamweaver 6, I created a new fluid layout. I set up (4) DIVs. In the 3rd div, I changed the font color. The new color shows up on the website when viewed in my computer desktop, but, when viewed in a tablet and a cell phone, the color of the font does not change. It's the same in Dreamweaver's Live view. It shows the new color on Desktop view and not in the cell phone or tablet view. Also, I changed the font itself in one of the DIVs and it shows up in the new font on the desktop view and website viewed thru the computer, but, not on the tablet or cell phone. Can someone please explain. I want to be able to change the fonts and colors for viewing in the tablet and cell phone, also. The fonts were all standard fonts. Sans-erif and Verdana and Arial were tried. Thanks.

    I will lock this discussion because of duplicate post.

  • Simple/silly question: how do I set/change default font/color for outgoing mail messages?

    Simple/silly question: how do I set/change default font/color for outgoing mail messages?

    Just a suggestion..........
    Download Thunderbird.  Easier to use when it comes to what you want to do w/your emails. 

  • Set global font size for the whole application.

    Is there a way of setting a font globally
    What I mean I want to set a font size for the whole application.
    Is this posable ??
    Thanks Craig

    After posting over 300 questions I would think you would be passed the "New to Java TechnologY" stage.
    The answer for Swing applications is yes this can be done.
    I don't know how to do it for AWT components.
    Since you posted the question in this forum (as oppose to the Swing forum for Swing related problems), I'm assuming this is an AWT related question and therefore I can't help you.

  • Problem to set background color for configTable cell

    Hi All,
    I've a configTable displays some status fields, and I need to set yellow color when the status is in processing and green when finished and red when cancelled. I've searched the forum and decided to use iterator with method RENDER_CELL_START. Here are the steps that I've done.
    Step 1: wrote a new class ZCL_ACTSTAT_ITERATOR implements interface IF_HTMLB_TABLEVIEW_ITERATOR.
        this class has a private attribute ORDERS containing the search result internal table data, in the CONSTRUCTOR method I pass the search result to the attribute using the statement ME->ORDERS = ORDERS. Then in the method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START I check the p_column_key for the status fields and then get the status value and set p_style accordingly using the following statement:
    CASE p_column_key.
        WHEN 'PREPAY_STATUS' OR 'DELVPLN_STATUS' OR 'DESIGN_STATUS'.
          READ TABLE me->orders INTO ls_order INDEX p_row_index.
          IF sy-subrc NE 0.
            EXIT.
          ENDIF.
          ASSIGN COMPONENT p_column_key OF STRUCTURE ls_order TO <col>.
          IF sy-subrc = 0.
            wf_text = <col>.
          ENDIF.
          IF wf_text = '00' OR wf_text = 'Initial'.
    *        concatenate '<font color=""red"">'
    *         WF_TEXT '</font>' into html_str.
    *        create object html_bee.
    *        html_bee->add( html = html_str ).
    *        p_replacement_bee = html_bee.        "not work either
            p_style = 'celldesign:STANDARD'.
          ELSEIF wf_text = '10' OR wf_text = 'InProcessing'.
            p_style = 'celldesign:GOODVALUE_MEDIUM'.
          ELSEIF wf_text = '20' OR wf_text = 'Finished'.
            p_style = 'celldesign:GOODVALUE_LIGHT'.
    *        p_style = 'background-color:#92D050'.
          ENDIF.
      ENDCASE.
    Step 2: In the component controller ZL_ZACT_MYO_ORDERS_IMPL, create a public attribute GV_ITERATOR type ref to the class created in step 1 (ZCL_ACTSTAT_ITERATOR), then in the controller's DO_PREPARE_OUTPUT method, get the combined context data and convert them into internal table LT_ORDERS, then create the iterator GV_ITERATOR passing LT_ORDERS, after this step, the result data can be transfered into iterator class and then be used in the RENDER_CELL_START method.
    The DO_PREPARE_OUTPUT method is like bellow:
    lr_pro ?= me->typed_context->order->collection_wrapper->get_first( ).
        WHILE lr_pro is BOUND.
          lr_pro->get_properties( IMPORTING es_attributes = ls_order ).
          if ls_order is not initial.
            append ls_order to lt_order.
          endif.
          lr_pro ?= me->typed_context->order->collection_wrapper->GET_next( ).
        ENDWHILE.
        CREATE OBJECT lc_iterator
          EXPORTING
            orders = lt_order.
        me->GV_iterator = lc_iterator.
    Step 3: in the .htm page, point iterator to controller's iterator
    <chtmlb:configTable  id                    = "Table1"
                        table                 = "//ORDER/Table"
                        iterator              = "<%= controller->GV_ITERATOR %>"
                         />
    Step 4: in the GET method of status attributes in context node ORDER, do the translation to change the status code into status description
    METHOD GET_PREPAY_STATUS
        DATA: OLD_VALUE TYPE ZACT_STATU,
              LS_STATUS TYPE ZACT_STATUS_S.
        OLD_VALUE = VALUE.
        READ TABLE GT_STATUS INTO LS_STATUS WITH KEY STATUS = OLD_VALUE.  
        "Get status description from field domain definition
        IF SY-SUBRC = 0.
          VALUE = LS_STATUS-NAME.           "Show status description
        ENDIF.
    ENDMETHOD.
    I thought I could see the status fields change their styles for different status code. But it still refuse to work, although I can debug to see that p_style really set as I expect, so I think there must have something wrong after RENDER_CELL_START, but what is it?
    Could anyone please help me sort it out or point out what's missing there or guide me the correct steps? Any post is greatly appreciated.
    Thank you!
    Jeff
    Edited by: liu jinghui on Feb 9, 2012 6:37 PM

    Hi, Jeff.
    Just don't want to cross post the same answer all over the forum. So I gave some inputs on the topic in this message: http://forums.sdn.sap.com/thread.jspa?messageID=11127647&#11127647
    Hope this will help you.

  • Changing JList non-editable Font color of the selected items

    Hi All,
    I want to change the font color of non-editable JList's selected items which is not clearly visible to user. And I need to change the font color only the selected item in this scenerio.
    Could you please clarify me?
    <img src="file:///C:/DOCUME~1/sgnanasi/LOCALS~1/Temp/moz-screenshot-4.png" alt="" />

    [email protected] wrote:
    ..I want to change the font color of non-editable JList's selected items which is not clearly visible to user. And I need to change the font color only the selected item in this scenerio.Set a custom [cell renderer|http://java.sun.com/javase/6/docs/api/javax/swing/ListCellRenderer.html] *(<- link)* for the JList.

  • Change font color in the Text Field of a Popup Key LOV

    Hello,
    I have a question concerning Popup Key LOV.
    I want to change the font color in the Text Field of the Popup Key LOV Item.
    I searched the forum but I cannot find an answer about this! Although I searched the CSS and the Popup Key LOV Template, but I do not know where to modify the font color.
    Has anyone an idea how to solve that problem?
    Regards,
    Tim

    Hey,
    thank for your reply!
    I use style="color:#000000;" and it work in Firefox, but not in Internet Explorer 7.0!
    And that is not the first time, that there are differences in displaying those tags in the HTML Form Element Attributes and in css files, etc.
    Does anybody know I to solve that?
    Thank you,
    Tim

  • Where can I change the font settings for the name of the month in iPhoto's calendar project?

    where can I change the font settings for the name of the month in iPhoto's calendar project?  I just ordered two copies of a calendar I designed in iPhoto and was surprised to find that the calendar's months were printing in something like an Arial 10 pt font.  On previous calendars I've printer via iPhoto and Apple, the font was much larger.  I've tried every menu option in iPhoto and the Calendar Project program and can't find where this is modifyable. Which leads me to ask, what the heck happened here in the first place?  I did not consciously change the default.
    I do remember that I got some notice when I first tried to print the calendar about the default font having been changed, but I don't know how this could have happened, and I didn't know what impact that had on the calendar until it was delivered.  I typically print about a dozen annual calendars but won't buy another until I've got a handle on this problem.  For the most part, the rest of the calendar is okay.
    As a P.S. is there anywhere where one can get a power user's manual, or instruction on iPhoto?
    Message was edited by: KPAausFrankfort

    "Maximum" and "12" usually refer to compression (influencing image quality and jpeg file size in bytes); and as Curt wrote, dpi is meaningless for display by and viewing in web browsers.  (It could be a different matter if you are uploading the jpeg files for someone to download from the web to print.)
    What are the sequence of steps that you and your batch processing take from Bridge?
    You can use call Photoshop's Image Processor from Bridge to create the jpeg files  (Tools > Photoshop > Image Processor).  In the Image Processor you can set jpeg compression, pixel dimensions if desired, also convert to sRGB (good idea for web display).  In my experience the image processor leaves unchanged whatever dpi is set in the source file; or, if none there as might be for a pdf, it will set the dpi value in your New Document Preset Print Resolution (from your Photoshop Units & Rulers preferences).

Maybe you are looking for

  • Problems reversing a Clearing document

    Dear Frieds, User has cleared few documents with Transaction Code F-32 during monthend process and now he wants to reverse the clearing document. Trying to reverse through FBRA Tcode but it's giving error message as u201C Balance of the line items is

  • Nokia N8-00 Belle Refresh - Gallery & Videos probl...

    Hi, my first problem is in Albums section. Whenever, every time when I add some photos from Gallery to any existing Album, everything works OK, until restart my phone! After new start/boot  of my N8 all Albums are again empty. Please help me with con

  • Duplicate catalog item; price editable

    Hi All, I have a client running SRM server 550; they have an issue that when a user creates a shopping cart and adds a catalog item, the price is not editable (as it should be). However, if the user then creates a copy that item, using the "duplicate

  • My submit email button if pushed twice puts email body in "to" address

    My submit email button if pushed twice puts email body in "to" address???? Any ideas???

  • How to remove a FLVPlayback Instance?

    Hi...after searching everywhere it seems as though the best way to avoid multiple problems with playing multiple FLV's in sequence is to remove the FLVPlayback instance and then reattach one. Problem is....how do you do it...ha! I attach it to a mc u