Tableview Cell - setting the font and background colors

Hi,
I am developing a BSP with a Tableview. The user asked me about displaying a row with a diferent color (font or background) when some data changes on this table.
I am thinking about using a Tableview Iterator to evaluate the content of a cell... but I dont know if I can change the look and feel of the row on where this cell is.
Has someone dealed with this? Can you tell me how?
thanks
Ariel

Actually this is the whole purpose of the Iterator.
I would suggest you take a look at the SBSEXT_HTMLB and SBSEXT_TABLE BSP Application as well as the following weblogs.
/people/thomas.jung3/blog/2004/09/15/bsp-150-a-developer146s-journal-part-xi--table-view-iterators
/people/sap.user72/blog/2004/09/07/bsp-howto-exploring-bsp-development-and-the-miniwas-620
/people/sap.user72/blog/2004/08/27/bsp-howto-tableview-iterator--column-header-graphics
/people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator
In those examples you'll see how easy it is to alter the content of the current cell or a cell with a specific value and output anything from graphics to input fields or dropdown boxes or even just change the text, color and styles of the content.

Similar Messages

  • How to change the font and background color in PowerShell

    From your error messages to your output parameters, changing the colors of different PowerShell variables and outcomes is a straightforward and useful way to customize your PowerShell console. You can quickly identify ouputs, error messages, parameters and more with simple color cues – and when you're dealing with a longer script, being able to quickly identify anything is a huge help.In aguide on how to configure and customize your color settingsin PowerShell, Petri walks through each and every step, and even donates some of itsown custom PowerShell color themes scripts. (It should be noted that this only works for PowerShell console and not PowerShell ISE.) You can access your color configuration by entering:Powershell$host.privatedataThis will pull up a list of all your colors as they are currently set.Image credit:Jeff HicksNow...
    This topic first appeared in the Spiceworks Community

    Use a custom Renderer. This is the JTable tutorial:
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

  • Setting fonts and Background color

    Hi,
    Is there anyway to set the font and background color on a jLabel? Thanks for your help!

    ...emmmm lets see... for the font and the background...
    maybe setFont and maybe setBackground!
    http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JComponent.html

  • Disabled font and background color

    I am trying to change the font and background color of a disabled h:inputtext tag. Currently, if I set disabled=true on an h:inputtext tag, the background in gray and the font is white. I would like to somehow customize that to be background gray and font color black. Any ideas?

    Check these
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ccb6bcf4-0401-0010-e3bc-ec0ef03e13d1
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d2b1d790-0201-0010-25b7-d1fb059a8ad9
    Regards, Anilkumar
    P.S : https://www.sdn.sap.com/irj/sdn/advancedsearch?query=theme&cat=sdn_library
    Message was edited by:
            Anilkumar Vippagunta

  • Changing font and background color for all components

    Hi,
    This is my first time writing a GUI, and I'm pretty new to Swing and Java. I just recently switched from C++, and so far Java seems to be doing a nice job =)
    Currently I have a gazilion components (textfields, labels, panels) and I'm wondering if there is a way to change their background/foreground colours without adding in setBackground/setForeground for every single component.
    I've done some researching onto using Look and Feel, but there aren't any current ones that suits my needs. And everyone seems to mention that programming your own is pretty complicated.
    My boss wants a slick white text on black background interface, so you can imagine that he's not very impressed with the current default greyish colours =)
    Thank you for any help!
    Cindy

    Hi Cindy,
    I'm not sure how effective a solution this will be, but you could try:UIManager.put("TextField.background", Color.BLACK); // Default text field background becomes blackThere are many more defaults you'd have to change and could probably achieve it more reliably and simply by creating or editing the properties file that controls the way the look and feel (even if it's the default) is implemented. Take a look at:
    http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/UIManager.htmlHope this is helpful
    Chris.

  • UITableView section header: How to find out font size and background color

    Hi, does anyone know how to find out the default font and default background color(or image?) used in the section header of a tableView
    I'd like to create a view with the same background color/image and use the same font (with different color) used by the section header

    I don't think there are any getter methods for a section header. But I wouldn't be surprised if the header was an object. You might try setting some header text to a key string and searching recursively through all the subviews for objects that respond to a text message. It might help to also print the description of objects that don't respond to text. I haven't tried this yet, but will let you know if I get any useful results.
    I guess another approach would be to use viewForHeaderInSection to set the font and color to whatever you wanted. Then you wouldn't have any problem matching it.

  • How to set default value and bg color of cross tab cell?

    Hi all
    Which way can I set default value and background color for a crosstab cell where there are no any data?
    I try to pass it in following way
    if isnull(CurrentFieldValue) then
    But is has no effect.

    Hi,
    If your field is numeric
    if currentfieldvalue =0 then cryellow else crnocolor
    if the field is numeric but you don't see the 0 check check if : Suppress if zero is ticked in the Number format tab.
    Regards

  • How to set text and background color of current row in a adf table?

    Hi,
    In jdev 11.1.2.3,
    How to set text fond and background color of current row in a adf table?
    I tried to set Background color in table property, but that is not what i want.
    Thanks.

    Hi,
    We almost had the same requirement, but we just needed to color a specific column.
    Here goes the solution to that, you might do the same for your row highlighting
    Changes are required in jsff and one method to be added in backing bean
    1. JSFF :
    <af:column headerText="Amount"
                     id="c4" width="100"
                     inlineStyle="#{backingBeanScope.BackingBean.cellColor}">2. Backing Bean
    //searchResultTableVO is Table's VO
    public String getCellColor() {
          FacesContext ctx = FacesContext.getCurrentInstance();
          ExpressionFactory ef = ctx.getApplication().getExpressionFactory();
          ValueExpression ve = ef.createValueExpression(ctx.getELContext(), "#{row}", FacesCtrlHierNodeBinding.class);
          FacesCtrlHierNodeBinding node = (FacesCtrlHierNodeBinding)ve.getValue(ctx.getELContext());
          Row row = node.getRow();
        if(row.equals(searchResultTableVO.getCurrentRow())){
    //You can add your inline style for font-style too
          return "background-color:Red;";
             return null;
      }Hope this is helpful :)
    Regards,
    Neha..

  • I am not satisfied with the font and size of print that I set. How do I change it?

    When I first set up Firefox on my desktop, I set the print size and font. I have found that it is too large and I really would like to change the font, also. I can't find a spot to do that. I might be looking right at it but don't realize it. Could you help me?

    I can't remember what I did when I set the font and size of articles that I printed from the pages on Firefox. I just know that I tried something a few months ago and have not been happy with the settings that I made. I can't find anywhere to change those settings and have tried so many things but they do not change the look of the pages I print when I click print. I tried to see if I could change the settings but all it does is change portrait or landscape and margins...nothing about fonts or sizes. I am getting so frustrated even though I love Firefox.

  • Numeric Control - Text and Background Color changes when operating inc/dec arrows

    Hi,
    I'm developing an application that has a panel with black background and green or red numbers. I've added numeric controls and configured the text color and text background color attributes accordinglingy. I set the numeric control to hot or validate  control mode and show the inc/dec arrows, since I want to be able to incr/decr the numbers.
    The problem is that when I run the application and I hit the inc/dec arrows, then the colors inside the numeric control frame become inverted: the black background becomes white and the green number becomes cyan. I've created a callback function assosicated with the numeric control and tried forcing the text and background color, in the EVENT_VAL_CHANGED section, using the SetCtrlAttrribute() function, but to no avail. Also added ProcessDrawEvents didn't help.
    When I mouse click again outside the numeric control, then it reverts back to its original colors (green text, black background).
    Any suggestions as to how I can fix this ?
    I want it to keep its original colors at all times, even when I'm clicking the incr/decr arrows...
    Kind regards,
    pgriep
    Solved!
    Go to Solution.

    Ok, now I see what's happening.
    The effect you are seeing is a resul of standard numeric control behaviour combined with the black bcakground: when you use arrows to increment/decrement a numeric control its value will be automatically highlighted; on the default background you'll see the white area and figures highlighted in black (white numbers on balck background). If you set the background to black the system will automatically change the colors used to highlight the text, and that's what you're seeing.
    By the way, this does not happens if you use up and down keys on the keyboard: text is not highlighted so colors are not changing.
    Additionally, this is not only valid for numerics: see the behaviour of the string controls on the bottom of your panel when you tab up to them. This effect does not happen on controls set as indicator like the big clock in the upper part of the panel.
    The only way I can see to overcome this behaviour is to hide control built-in arrows and create your own up and down buttons with which you can manipulate the numeric control. I am attaching a modified version of your project with buttons on the left numeric; sorry for the poor aesthetic:  I have used some arrow icons I had on my disk, you may want to create your own arrows with the colors and shape you prefer.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?
    Attachments:
    ModifiedApplication.zip ‏9 KB

  • Setting the font of a UITextField control

    I am using a UITextField control to create text offscreen, then I'm using ImageSnapshot to get a bitmap and draw it on the screen using graphics methods. It's working fine, except for one thing: for the life of me I cannot change the font used from Times Roman.
    I've scoured the internet and tried many things, such as using a style (stylename=, not setStyle), trying the setTextFormat function, but nothing works.
    I have a work-around using a label control that is part of the parent container with visible=false, but it is not correctly autosizing as I'd like and there are other issues that crop up in this approach.
    Does anyone know how to how to set the font and get it to be used? Here is a snippet of code:
                        var sizeText : UITextField = new UITextField();
                        sizeText.autoSize = TextFieldAutoSize.LEFT;
                        sizeText.background = true;
                        var textFormat : TextFormat = new TextFormat( "Arial", 13, 0xAAAAAA );
                        sizeText.setTextFormat( textFormat );
                        sizeText.text = "blah";
                        var textBitmapData:BitmapData = ImageSnapshot.captureBitmapData( sizeText );
                        var coef:Number = Math.min( sizeText.measuredWidth / textBitmapData.width, sizeText.measuredHeight / textBitmapData.height );
                        sizeMatrix = new Matrix(coef, 0, 0, coef);
                        textBitmapData = ImageSnapshot.captureBitmapData( sizeText, sizeMatrix );
    Thx in advance, d.

    Maybe but doubtful.  Now that you are using TextField, you must next decide on whether you are using embedFonts or not and set that property correctly.  Next, I would set defaultTextFormat to the same TextFormat you are using for setTextFormat.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Setting the font

    I am trying to figure out how to set the font and this is what I have come up with up so far:
    AIFontKey fontKey;
    error = sAIFont->FindFont( "Arial", kAIAnyFontTechnology, kRomanAIScript, true, &fontKey );
    if (error) throw (error);
    FontRef fontRef;
    error = sAIFont->FontFromFontKey( fontKey, &fontRef );
    if (error) throw (error);
    IFont iFont( fontRef);
    features.SetFont( iFont);
    I am not sure if I am doing this correct. I took most of this code form another post, but was  not sure how to implement the code.
    I am trying to set the font and am using the below code to set the font size and the position of the text:
    ATE::IParaFeatures justif;
    ATE::ICharFeatures features;
    justif.SetLeadingType(ATE::kRomanLeadingType);
    justif.SetStartIndent(kAIRealZero);
    justif.SetFirstLineIndent(kAIRealZero);
    features.SetTracking(kAIRealZero);
    //Justification.
    justif.SetJustification(kCenterJustify);
    //Size
    features.SetFontSize(10);
    AIArtHandle artGroup = NULL;
    error = sAIArt->GetFirstArtOfLayer(NULL, &artGroup);
    aisdk::check_ai_error(error);
    // Add the new point text item to the layer.
    AITextOrientation orient = kHorizontalTextOrientation;
    AIRealPoint anchor = {this->fEndPoint.h,this->fEndPoint.v-4};
    AIArtHandle textFrame = NULL;
    error = sAITextFrame->NewPointText(kPlaceAboveAll, artGroup, orient, anchor, &textFrame);
    aisdk::check_ai_error(error);
    // Set the contents of the text range.
    TextRangeRef range = NULL;
    error = sAITextFrame->GetATETextRange(textFrame, &range);
    aisdk::check_ai_error(error);
    ITextRange crange(range);
    crange.SetLocalCharFeatures(features);
    crange.SetLocalParaFeatures(justif);
    crange.InsertAfter("X");
    Any help would help thanks daniel

    Okay, here is what I decided to do...it is lame, but it works. Thanks for the help. : )
    char buf[250], fonttext[500];
    short forfont;
    long fontCount = 0;
    int font_value;
    error = sAIFont->CountFonts(&fontCount);
    //char buffer[sizeof(long)*8+1];
    //MessageBox(NULL, ltoa(fontCount, buffer, 10), "Font Num", 0);
    aisdk::check_ai_error(error);
    for (int i = 0; i < fontCount; i++)
    // Report each font name to the log.
    AIFontKey fontKey = NULL;
    error = sAIFont->IndexFontList(i, &fontKey);
    aisdk::check_ai_error(error);
    error = sAIFont->GetUserFontName(fontKey,fonttext,forfont);
    if(strcmp(fonttext, "Arial Bold") == 0)
    font_value = i;
    break;
    else
    font_value = -1;
    aisdk::check_ai_error(error);
    FontRef fontRef;
    AIFontKey fontKey = NULL;
    //For instance, 10 is a number of the font in the font list.
    error = sAIFont -> IndexFontList(font_value, &fontKey );
    error = sAIFont -> FontFromFontKey ( fontKey, &fontRef );
    ATE::IFont iFont( fontRef );
    features.SetFont( iFont );

  • Setting the font style and color for FileChooser labels

    Hi Friends,
    I have a certain standard Font style and color set for my application GUI. Now, I want to set the style and color for Swing components like FileChooser. Is it possible ?
    Also is it possible to localize JOptionPane ?
    Please advise.
    Best regards,
    Harilal.

    Does anybody knows how to do that?

  • 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

  • Apple Mail color coding both font and background

    Is there a way to color-code both the font and the background of emails via Rules? As soon as you set a rule to color code one of them another becomes unavailable. This is probably by design but then I'd say this is very stupid design. I do not see any reason why both can not be set except that nobedy from Apple uses this feature .

    Before starting to complain, I have to admit that Mail.app made me switch from other rss and mail applications. It works well and I like having rss and mail in one program.
    But I totaly agree with you, I found this post by trying to find a fix for this ugly header. Also it's a mistery to me why the source name is the main title and the subject is the smaller sub title...
    And while I'm at it, just one more thing, this rss header or at least the title should be a link. So that if you want to open the selected post in your browser, you don't have to scroll down to the "read more" link.

Maybe you are looking for