COLOR for Lists

Hi,
I have created a employee list with 4Columns and 3 Rows using uline and sy-vline.My problem is hoe to give the background color for the Individual field.
My Lists will be,
EmpID   EmpName   Age        DOJ
x            yyyy             23  08/11/2008
y            xxxxxx          25  08/08/2008
How to give the color for the header part empid,empname...
and the detail part.
please help me to solve this problem.
Thanx in advance
Mohana

Try the following piece of code,
This is for coloring the backgrounds of table fields. As you can see from the code, it colors the header titles and the rest of the data with different colors.
*  FORM DISP_TAB_VEND_PROD_GRP                                         *
*  Subroutine for displaying the data for the grouping based on vendor *
*  and Product group                                                   *
*  There are no interface parameters to be passed to this subroutine.  *
FORM disp_tab_vend_prod_grp .
  CLEAR w_total_amt.
  SORT t_vend_prod_grp BY matkl lifnr.
  LOOP AT t_vend_prod_grp INTO fs_vend_prod_grp.
    w_total_delv = w_total_delv + 1.
    w_total_amt = w_total_amt + fs_vend_prod_grp-dmbtr.
    AT NEW matkl.
* To display the material group and the header texts for the data
* grouped by material group and vendor.
      SKIP 1.
      WRITE:/ text-mtk COLOR COL_HEADING
                               INTENSIFIED,
              fs_vend_prod_grp-matkl COLOR COL_NORMAL
                               INTENSIFIED OFF.
      SKIP 1.
      FORMAT COLOR COL_HEADING ON INTENSIFIED.
      ULINE  1(54).
      WRITE:/ sy-vline,
            2 text-ven,
           12 sy-vline,
              text-dlv,
           26 sy-vline,
           38 text-amt,
              sy-vline,
           46 text-cur,
           54 sy-vline.
      ULINE /1(54).
      FORMAT COLOR COL_HEADING OFF INTENSIFIED.
    ENDAT.                             " AT NEW MATKL
    AT END OF lifnr.
* To display the actual data for the grouping based on Material group
* and Vendor.
      FORMAT COLOR COL_NORMAL ON INTENSIFIED OFF.
      WRITE: / sy-vline,
             2 fs_vend_prod_grp-lifnr COLOR COL_KEY,
            12 sy-vline,
               w_total_delv,
            26 sy-vline,
               w_total_amt CURRENCY text-usd,
               sy-vline,
            46 text-usd,
            54 sy-vline.
      FORMAT COLOR COL_NORMAL OFF INTENSIFIED OFF.
      CLEAR: w_total_amt,
             w_total_delv.
    ENDAT.                             " AT END OF LIFNR
    AT LAST.
      ULINE /1(54).
    ENDAT.                             " AT LAST
  ENDLOOP.                             " LOOP AT T_VEND_PROD_GRP
ENDFORM.                               " DISP_TAB_VEND_PROD_GRP
I dont know about the exact requirement of yours, but why dont you go for ALV grid display, it would look really good (and without much hand coding).

Similar Messages

  • How to give Common Background color for all JPanels in My Swing application

    Hi All,
    I am developing a swing application using The Swing Application Framework(SAF)(JSR 296). I this application i have multiple JPanel's embedded in a JTabbedPane. In this way i have three JTabbedPane embedded in a JFrame.
    Now is there any way to set a common background color for the all the JPanel's available in the application??
    I have tried using UIManager.put("Panel.background",new Color.PINK);. But it did not work.
    Also let me know if SAF has some inbuilt method or way to do this.
    Your inputs are valuable.
    Thanks in Advance,
    Nishanth.C

    It is not the fault of NetBeans' GUI builder, JPanels are opaque by default, I mean whether you use Netbeans or not.Thank you!
    I stand corrected (which is short for +"I jumped red-eyed on my feet and rushed to create an SSCCE to demonstrate that JPanels are... mmm... oh well, they are opaque by default... ;-[]"+)
    NetBeans's definitely innocent then, and indeed using it would be an advantage (ctrl-click all JPanels in a form and edit the common opaque property to false) over manually coding
    To handle this it would be better idea to make a subclass of JPanel and override isOpaque() to return false. Then use this 'Trasparent Panel' for all the panels where ever transparency is required.I beg to differ. From a design standpoint, I'd find it terrible (in the pejorative sense of the word) to design a subclass to inconsistently override a getter whereas the standard API already exposes the property (both get and set) for what it's meant: specify whether the panel is opaque.
    Leveraging this subclass would mean changing all lines where a would-be-transparent JPanel is currently instantiated, and instantiate the subclass instead.
    If you're editing all such lines anyway, you might as well change the explicit new JPanel() for a call to a factory method createTransparentJPanel(); this latter could, at the programmer's discretion, implement transparency whichever way makes the programmer's life easier (subclass if he pleases, although that makes me shudder, or simply call thePanel.setOpaque(false) before returning the panel). That way the "transparency" code is centralized in a single easy to maintain location.
    I had to read the code for that latter's UI classes to find out the keys to use (+Panel.background+, Label.foreground, etc.), as I happened to not find this info in an authoritative document - I see that you seem to know thoses keys, may I ask you where you got them from?
    One of best utilities I got from this forum, written by camickr makes getting these keys and their values very easy. You can get it from his blog [(->link)|http://tips4java.wordpress.com/2008/10/09/uimanager-defaults/]
    Definitely. I bit a pair of knucles off when discovered it monthes after cumbersomely traversing the BasicL&F code...
    Still, it is a matter-of-fact approach (and this time I don't mean that to sound pejorative), that works if you can test the result for a given JDK version and L&F, but doesn't guarantee that these keys are there to stand - an observation, but not a specification.
    Thanks TBM for highlighting this blog entry, that's the best keys list device I have found so far, but the questions still holds as to what specifies the keys.
    Edited by: jduprez on Feb 15, 2010 10:07 AM

  • Color  for a Field in alv output

    Hi All,
    I use a field in the ALV grid output which needs to display color (red or green) depending on certain validations. Please tell me how to display color for this field. The program uses oops.
    Thanks.

    Hi
    1. add one more field to ur final internal table say COLOR(4)
    2. in layout wa_layout-style_fname = 'COLOR'. " if its grid
    wa_layout-style_fieldname = 'COLOR'. "if its list
    3. read table itab index 3.
    itab-color = 'C410'.
    modify itab index 3
    4. see program SHOWCOLO for all color codes
    1. Add a field of data type CHAR(3) to the internal output table.
    2. Enter the color code in the appropriate field of the row to be colored in the internal
    output table:
    Code: 'Cxy'
    C = Color (all codes begin with 'C')
    x = color number ('1' - '9')
    y = highlight ('0' = off, '1' = on)
    3. Assign the internal output table color code field name to the IS_LAYOUT importing
    structure IS_LAYOUT-INFO_FIELDNAME field and pass this structure in the ALV call
    interface.
    To enable row coloring, you should add an additional field to your list data table. It should be of character type and length at least 4. This field will contain the color code for the row. So, let’s modify declaration of our list data table “gt_list”.
    you should fill the color code to this field. Its format will be the same as explained before at section C.6.3. But how will ALV Grid know that you have loaded the color data for the row to this field. So, you make it know this by passing the name of the field containing color codes to the field “INFO_FNAME” of the layout structure.
    e.g.
    ps_layout-info_fname = <field_name_containing_color_codes>. “e.g. ‘ROWCOLOR’
    You can fill that field anytime during execution. But, of course, due to the flow logic of screens, it will be reflected to your list display as soon as an ALV refresh occurs.
    You can color an entire row as described in the next section. However, this method is less time consuming.
    Coloring Individual Cells
    This is the last point about coloring procedures for the ALV Grid. The procedure is similar to coloring an entire row. However, since an individual cell can be addressed with two parameters we will need something more. What is meant by “more” is a table type structure to be included into the structure of the list data table. It seems strange, because including it will make our list data structure deep. But anyhow ALV Grid control handles this.
    The structure that should be included must be of type “LVC_T_SCOL”. If you want to color the entire row, this inner table should contain only one row with field “fname” is set to space, some color value at field “col”, “0” or “1” at fields “int” (intensified) and “inv” (inverse).
    If you want to color individual cells, then for each cell column, append a line to this inner table which also contains the column name at field “fname”. It is obvious that you can color an entire column by filling this inner table with a row for that column for each row in the list data table.
    Reward points if useful
    Regards
    Anji

  • How to change background color in List of Values (LOV) ?

    Hiya
    In Forms 10g, the background color in list of values (LOV) is White whereas it was grey in Form 6i. Also, the position of 3 buttons i.e. Find, OK and Cancel on LOV is different than what it used to be in Forms 6i.
    Is it possible to change the background color and the position of buttons of LOV in Forms 10g ?
    Cheers
    Mayur

    I would like to share the outcome of this issue.
    I had posted this same issue on Metalink yesterday. They (Metalink guys) have confirmed that its an bug in Oracle 10g DS R2 and it would be fixed in subsequent releases.
    Following is an official response from Metalink:
    This issue has been addressed to Oracle Development to be investigated/fixed in the published Bug:
    Bug 1559776 <BACKGROUND COLOR SETTING FOR LOV OBJECT DOES NOT WORK ON WEB>
    Cheers
    Mayur

  • How to set different color for items in selectManyCheckbox

    hi,
    I would like to change item text background color for each item on selectManyCheckbox (different for each item).
    It is only 5 items so that could be static reference or select.
    I know only how to change background for all items
    af|selectManyCheckbox::item-text {
        background:orange;
    How to select concrete item text and change color for only them?
    I found similar problem:
    css - Set background color of every individual checkbox of p:selectManyCheckbox - Stack Overflow
    but this dont work for me because I dont have in adf tr structure
    I need somethink like this:
    af|selectManyCheckbox::item-text XXXX - select here one of the item by number on list or id  {
        background:orange;

    hi,
    thanks Alejandro and Federico for answers.
    I use JDev 11.1.1.6. I dont write it in previously post because I think that is a more css then adf problem.
    I have 5 selectItem based on simple List<String> {"text1", "text2", "text3", "text4". "text5"}:
    <af:selectManyCheckbox label="List" id="smc2"
                                               layout="horizontal"
                                               value="#{bean.listInBean}"
                                               autoSubmit="true">
                          <af:selectItem label="text1" value="text1" id="si47"/>
                          <af:selectItem label="text2" value="text2" id="si43"/>
                          <af:selectItem label="text3" value="text3" id="si46"/>
                          <af:selectItem label="text4" value="text4" id="si45"/>
                          <af:selectItem label="text5" value="text5" id="si44"/>
                        </af:selectManyCheckbox>
    and I would like to color first selectItem text to orange, second to red.. etc, The list is a static list. Not would be changed.
    After Alejandro answer I build simple for each element (anyCollection contains item with two fields: textValue and label {(text1,text1), (text2,text2)...}
      <af:forEach items="#{bean.anyCollection}"
                                      var="item">
                            <af:selectItem id="si48" value="#{item.textValue}"  styleClass="yourClassName#{var.index}"
                                           label="#{item.label}"/>
                          </af:forEach>
    And now if I have my var called "item" I can write 5 css style classe yourClassName#{var.index} with different color, but there is a problem:
    Attribute styleClass is not defined for af:selectItem
    If it will be so simple I will just add 5 style classes for each selectItem
    <af:selectItem label="text1" value="text1" id="si47" styleClass="yourClassName0"/>
    <af:selectItem label="text2" value="text2" id="si43" styleClass="yourClassName1"/>
    Should I use other component then adf facer rich?

  • Set-up custom font, font size, and color for writing new and reply e-mails in Thunderbird

    I know that I can select the font, size, and color for writing each new and reply e-mails in Thunderbird, but I don't want to have to do this each time. I want to set-up the default font, size, and color for all new and reply e-mails. It already comes up with a default one, but I want to change it, but can't figure out how to do this. I'm sure it is quite simple, but I don't know how to do this. Thank you in advance for help.

    Tools > Options > Display > Formatting tab
    Default font: select font
    Select size : eg; 14
    Click on 'Advanced' button and set all the sizes to 14
    Select : 'allow messages to use other fonts'
    click on OK
    Click on 'Composition'
    Under the 'General' tab
    Suggest you set HTML font to 'Variable width' and Size : 'Medium'
    Select the 'Text colour' you would like to compose email using
    Select the 'Background colour' you would like to use when composing emails.
    click on OK to save all changes.
    This will set the display email list to the selected font.
    It will allow received emails to use the font the sender used.
    When you compose an email it will also use the same font settings.
    The message 'Display' settings in the above section also apply to messages that you compose. The settings are not sent, so they do not affect how your messages appear to recipients.
    The settings in the ''Composition' section can affect how messages are sent. If you make unusual choices, then people who receive messages from you might find them difficult or impossible to read. Hence, why I suggest you leave it as 'Variable width' and allow the 'Display' settings to set the default used for composing emails.
    More info:
    * http://kb.mozillazine.org/Font_settings_in_Thunderbird

  • Can I set default colors for generated shapes in Premiere Pro CC?

    I'm working on some highlight video where I need to generate an ellipse on each clip to highlight a player. I'd like to use a yellow/yellow, 20% softness, 8 thickness ellipse each time, but by default PP gives me an ugly green/blue combination, and I have to change the inside/outside colors, softness and thickness each time I add a clip and generate an ellipse.
    Is there a way to set a default inner/outer color, thickness, and softness setting for each new generated shape so that I don't have to keep repeating these steps?

    If you are using the Title Designer to generate your ellipse, and if I understand what you want, the answer is yes.
    Unless I am completely off-base, your default font style below the title has the colors of that ugly green/blue combo.
    You can easily just set the ellipse the exact way you want it, and then go into the Font Styles menu and create a new font style. Give it a unique name like "Ellipse" and then drag that new style from the end up to the beginning of the list. (Upper left hand corner).
    I created an ellipse using a greenish yellow, rather unattractive color for both the shape and the stroke. I used a higher opacity because it shows up better in the screen shot, but I could have set it for 20% easily enough. I then went to the styles menu, created a new style, gave it a name, then went to the last style and dragged it up to the top left where you see it now. You have to look close.
    It is not particularly obvious that the shapes are based on the font style just as much as the text is.

  • Automatic Fill colors for Report Builder pie charts and graphs are too repetitive and hard to differentiate

    I have pie charts or other graphs that show multiple results (7-20).  I set the "fill" colors to Automatic so that the results are dynamic (I don't want to specify a color for each result because I will then be limited that those results--I
    prefer it to be dynamic).
    I noticed that once you get above 4 or 5 results, no matter which palette is used, the "automatic" colors are so closely similar that it is hard to differentiate which color pertains to which result (group).  For example, you could have a
    reports that breaks the results into age groups like 1-18, 19-21, 22-25, 26-30, 31-41, 41-50, 51-65, 66-80, and 81+.  By the time you review the results, there's likely to be 3 pairs of colors (or more) that are so closely similar that you can't
    tell them apart (2 shades of yellow, 3 shades of blue, 2 shades of orange, or green, or teal, or purple or whatever).
    Is there a way to use Automatic for the color scheme (I don't care which color pertains to which category) but also specify to not use colors that seem to bleed together (so that someone viewing the report can actually tell the difference)?  Using SSRS
    2008 Report Builder, if it makes a difference.

    Hi JNehman,
    Reporting Services provides a list of predefined, built-in palettes that you can use to define a color set for series on your chart. All built-in palettes contain between 10 and 16 color values. You cannot extend the built-in palette to include more colors,
    so if you need more than 16 colors, you must define a custom palette.
    A custom palette let you add your own colors in the order you want them to appear on the chart. A custom palette is especially helpful if the number of series in your chart is unknown at design time. For more information, see
    Define Colors on a Chart Using a Palette (Report Builder and SSRS).
    Regards,
    Heidi Duan
    Heidi Duan
    TechNet Community Support

  • Conditional Color Coded List

    I have done this in excel long time ago and I though it was going to be as simple as it was with excel.
    I'm trying to implement a conditional color coded list with the criteria below:
    Fields:
    - Health (blank cell that will change colors)
    - Due Date (cell with dates)
    Criteria:
    - Red if [due date] < date.now
    - Yellow if [due date] > date.now - 10
    - Green everything else
    How would I implement that in SharePoint?
    Thanks in advance
    ps:I'm not a C# programmer so I don' t know if the syntax for datetime or dude date column are right. 

    Hi mpaulopes,
    Here is a step by step guide reference to provision conditional formatting using SharePoint designer. It will give you proper idea about how to do this. It is for SP2010 however it won't make much difference.
    http://blog.sharepointrx.com/2010/12/03/conditional-formatting-and-date-comparisons-with-sharepoint-designer-2010/
    I hope this helps.
    Regards,
    Tapan

  • [JS] User Interface to Choose Layer Color (Get List of UIColors)

    I know how to set layer color with UIColors so I am not somewhat familiar with how it works. I want to create a dialog (which I know how to do) that has a menu that lets a user choose their layer color. So I want to get a list of all the UIColors and present that as a menu to the user. I cannot figure out how to get this list of colors. I know how to access them individually, but I'd think it would act similar to an array. I can't figure out the code to access the list to use it in a menu. Is this possible and if so how?
    P.S. I am supporting InDesign CS2 and CS3.
    Thanks in advance.
    Dan

    Thanks for all the help everyone. We finally have the answer. Here's the following code that I'll be using. While Kasyan's works, I went ahead and made the menu a little nicer to read (like InDesign's actual menu is). My first array is for the dialog's menu, the second array contains the proper code I need later for setting the menu color. Again, thanks for all the input. Doing this in just CS3 was so much easier, but I also need to support CS2, so this works just fine (in both CS2 and CS3).
    myLayerColorMenuArray = [ "Light Blue" ,
         "Red" ,
         "Green" ,
         "Blue" ,
         "Yellow" ,
         "Magenta" ,
         "Cyan" ,
         "Gray" ,
         "Black" ,
         "Orange" ,
         "Dark Green" ,
         "Teal" ,
         "Tan" ,
         "Brown" ,
         "Violet" ,
         "Gold" ,
         "Dark Blue" ,
         "Pink" ,
         "Lavender" ,
         "Brick Red" ,
         "Olive Green" ,
         "Peach" ,
         "Burgundy" ,
         "Grass Green" ,
         "Ochre" ,
         "Purple" ,
         "Light Gray" ,
         "Charcoal" ,
         "Grid Blue" ,
         "Grid Orange" ,
         "Fiesta" ,
         "Light Olive" ,
         "Lipstick" ,
         "Cute Teal" ,
         "Sulphur" ,
         "Grid Green" ,
         "White" ]
    myInDesignUIColorArray = [ "lightBlue" ,
         "red" ,
         "green" ,
         "blue" ,
         "yellow" ,
         "magenta" ,
         "cyan" ,
         "gray" ,
         "black" ,
         "orange" ,
         "darkGreen" ,
         "teal" ,
         "tan" ,
         "brown" ,
         "violet" ,
         "gold" ,
         "darkBlue" ,
         "pink" ,
         "lavender" ,
         "brickRed" ,
         "oliveGreen" ,
         "peach" ,
         "burgundy" ,
         "grassGreen" ,
         "ochre" ,
         "purple" ,
         "lightGray" ,
         "charcoal" ,
         "gridBlue" ,
         "gridOrange" ,
         "fiesta" ,
         "lightOlive" ,
         "lipstick" ,
         "cuteTeal" ,
         "sulphur" ,
         "gridGreen" ,
         "white" ]
    var myDoc = app.activeDocument;
    var myDialog = app.dialogs.add({name:"Select Color"});
    with(myDialog.dialogColumns.add()){
       staticTexts.add({staticLabel:"Choose a color for the active layer."});
       var myDropdown = dropdowns.add( {stringList:myLayerColorMenuArray, selectedIndex:0} )
    var myResult = myDialog.show();
    var myIndex = myDropdown.selectedIndex;
    if(myResult == true){
       myDoc.layoutWindows[0].activeLayer.layerColor = eval('UIColors.' + myInDesignUIColorArray[myIndex]);
    else{
       alert("You clicked the Cancel button.");
    myDialog.destroy();

  • A quick way to set different color for certain items in JList?

    is there a quick way of setting different color for certain items in JList?

    Either use HTML strings as the values in your JList (quickest, but may not be the most convenient, especially if your model isn't just text), or create your own ListCellRenderer (e.g. extend DefaultListCellRenderer).
    There is no such thing as "list.setItemForeground(int index, Color c)". You'll have to use one of the methods above.

  • Hw do i set background color for ComboBox?

    If anyone knows how to set background color for disabeld (setEnabled(false)) of ComboBox in Windows Look and Feel. It will help me a lot.
    I don't know hoe to do it
    regards
    arun.

    At the start of your program add:
    UIManager.put("ComboBox.disabledBackground", Color.green);
    UIManager.put("ComboBox.disabledForeground", Color.blue);For a list of all the properties you can change with the UIManager see:
    http://www.discoverteenergy.com/files/ShowUIDefaults.java

  • Highlight color for Combobox

    I have a JComboBox, when i navigate between the various items inside the Combobox, it gets highlighted by some color. I want to know how to get that color object, i want to use the same color for something else. What would be the RGB combination for tat color?

    Popup, or drop down, list of JComboBox is a JList object.
    JList has getSelectionBackground() and ---Foreground() methods to get selection highlight
    color. In order to access the JList object in a JComboBox, study the source code
    JComboBox.java. Especially, its AccessibleJComboBox() constructor is the key.
    Alternately, you could use:
    UIManager.getColor("ComboBox.selectionBackground")
    // and
    UIManager.getColor("ComboBox.selectionForeground")

  • Color Definitions List - No Scroll

    I have a large color definitions list that matches my standard swatches in Illustrator.
    I want to go in and thin out some old/obsolete swatches (color definitions).
    I've recently upgraded to FrameMaker 11. I cannot scroll in the Color Definitions Name field. I use the drop down arrow to dig into the list, but the list itself won't scroll. Hovering on the scroll arrow does nothing. Clicking it just selects that color at the bottom of the list.
    Ideas? Is there any other way to scroll through the list or see the list?
    I'm in FrameMaker 11.0.1
    View > Color > Definitions...

    As Van says, it's a very poor implementation of th scroll list. I just created an Indexed PNG to get a large list of values for the colours to test this out.
    You have to click&hold on the arrow at the lower left and then drag the pointer down *outside* of the list window to start to scroll. On a fast machine, it just jumps to the end. If you let go, the list disappears. When you're past the first screen of the list, there's also an up arrow at the top that behaves in a similar way.
    The FM UI designer must have been having a very bad day...

  • Dynamically format colors in lists

    I would like to dynamically set a color for a single in a list.
    Ie rather than code:
    If var = 'x'. write l_field color col_negative.
    elseif var = 'y' write l_field color col_total.
    elseif var = 'z' write l_field color col_group.
    endif.
    I would like to code it as follows:
    data: l_color(10) type c.
    if l_var = 'x'.
    move 'col_negative' to l_color.
    elseif l_var = 'y' move 'col_total to l_color.
    elseif l_var = 'z' move 'col_group' to l_color.
    endif.
    write: l_field color l_color.
    The color command does not seem to like being passed a variable, rather it has to be told explicitly what the color should be set at.
    Is there a way around this?

    Check this report...You might find it helpfull:
    REPORT Z_ATG_DUMMY.
    DATA I TYPE I VALUE 0.
    DATA COL(15) TYPE C.
    WRITE:/9 'INTENSIFIED ON',27 'INTENSIFIED OFF',48 'INVERSE'.
    SKIP 2.
    WHILE I < 8.
      CASE I.
        WHEN 0. COL = 'COL_BACKGROUND '.
        WHEN 1. COL = 'COL_HEADING '.
        WHEN 2. COL = 'COL_NORMAL '.
        WHEN 3. COL = 'COL_TOTAL '.
        WHEN 4. COL = 'COL_KEY '.
        WHEN 5. COL = 'COL_POSITIVE '.
        WHEN 6. COL = 'COL_NEGATIVE '.
        WHEN 7. COL = 'COL_GROUP '.
      ENDCASE.
      FORMAT INTENSIFIED COLOR = I.
      WRITE: /(4) I, AT 7 SY-VLINE,
      COL, SY-VLINE,
      COL INTENSIFIED OFF, SY-VLINE,
      COL INVERSE.
      I = I + 1.
    ENDWHILE.
    Greetings,
    Blag.

Maybe you are looking for