How to set background color in a docking container?

Hi guys!
Is it possible to set a background color for a docking container?
I don't find any appropriate method to do that.
Is there actually a way?

Hi,
Please refer the below program as a reference for Color using Docking Container Concept.
REPORT zcuitest_alv_07.
* Use of colours in ALV grid (cell, line and column)            *
* Table
TABLES : mara.
* Type
TYPES : BEGIN OF ty_mara,
          matnr         LIKE mara-matnr,
          matkl         LIKE mara-matkl,
          counter(4)    TYPE n,
          free_text(15) TYPE c,
          color_line(4) TYPE c,           " Line color
          color_cell    TYPE lvc_t_scol,  " Cell color
END OF ty_mara.
* Structures
DATA  : wa_mara     TYPE ty_mara,
        wa_fieldcat TYPE lvc_s_fcat,
        is_layout   TYPE lvc_s_layo,
        wa_color    TYPE lvc_s_scol.
* Internal table
DATA : it_mara     TYPE STANDARD TABLE OF ty_mara,
       it_fieldcat TYPE STANDARD TABLE OF lvc_s_fcat,
       it_color    TYPE TABLE          OF lvc_s_scol.
* Variables
DATA : okcode LIKE sy-ucomm,
       w_alv_grid          TYPE REF TO cl_gui_alv_grid,
       w_docking_container TYPE REF TO cl_gui_docking_container.
PARAMETERS : p_column AS CHECKBOX,
             p_line   AS CHECKBOX,
             p_cell   AS CHECKBOX.
START-OF-SELECTION.
  PERFORM get_data.
END-OF-SELECTION.
  PERFORM fill_catalog.
  PERFORM fill_layout.
  CALL SCREEN 2000.
*&      Module  status_2000  OUTPUT
*       text
MODULE status_2000 OUTPUT.
  SET PF-STATUS '2000'.
ENDMODULE.                 " status_2000  OUTPUT
*&      Module  user_command_2000  INPUT
*       text
MODULE user_command_2000 INPUT.
  DATA : w_okcode LIKE sy-ucomm.
  MOVE okcode TO w_okcode.
  CLEAR okcode.
  CASE w_okcode.
    WHEN 'BACK'.
      LEAVE TO SCREEN 0.
  ENDCASE.
ENDMODULE.                 " user_command_2000  INPUT
*&      Module  alv_grid  OUTPUT
*       text
MODULE alv_grid OUTPUT.
  IF w_docking_container IS INITIAL.
    PERFORM create_objects.
    PERFORM display_alv_grid.
  ENDIF.
ENDMODULE.                 " alv_grid  OUTPUT
*&      Form  create_objects
*       text
*  -->  p1        text
*  <--  p2        text
FORM create_objects.
* Ratio must be included in [5..95]
  CREATE OBJECT w_docking_container
    EXPORTING
      ratio                       = 95
    EXCEPTIONS
      cntl_error                  = 1
      cntl_system_error           = 2
      create_error                = 3
      lifetime_error              = 4
      lifetime_dynpro_dynpro_link = 5
      others                      = 6.
  CREATE OBJECT w_alv_grid
    EXPORTING
      i_parent          = w_docking_container.
ENDFORM.                    " create_objects
*&      Form  display_alv_grid
*       text
*  -->  p1        text
*  <--  p2        text
FORM display_alv_grid.
  CALL METHOD w_alv_grid->set_table_for_first_display
    EXPORTING
      is_layout                     = is_layout
    CHANGING
      it_outtab                     = it_mara
      it_fieldcatalog               = it_fieldcat
    EXCEPTIONS
      invalid_parameter_combination = 1
      program_error                 = 2
      too_many_lines                = 3
      OTHERS                        = 4.
ENDFORM.                    " display_alv_grid
*&      Form  get_data
*       text
*  -->  p1        text
*  <--  p2        text
FORM get_data.
  SELECT * FROM mara UP TO 5 ROWS.
    CLEAR : wa_mara-color_line, wa_mara-color_cell.
    MOVE-CORRESPONDING mara TO wa_mara.
    ADD 1                   TO wa_mara-counter.
    MOVE 'Blabla'           TO wa_mara-free_text.
    IF wa_mara-counter = '0002'
    AND p_line = 'X'.
* Color line
      MOVE 'C410' TO wa_mara-color_line.
    ELSEIF wa_mara-counter = '0004'
    AND p_cell = 'X'.
* Color cell
      MOVE 'FREE_TEXT' TO wa_color-fname.
      MOVE '5'         TO wa_color-color-col.
      MOVE '1'         TO wa_color-color-int.
      MOVE '1'         TO wa_color-color-inv.
      APPEND wa_color TO it_color.
      wa_mara-color_cell[] = it_color[].
    ENDIF.
    APPEND wa_mara TO it_mara.
  ENDSELECT.
ENDFORM.                    " get_data
*&      Form  fill_catalog
*       text
*  -->  p1        text
*  <--  p2        text
FORM fill_catalog.
* Colour code :                                                 *
* Colour is a 4-char field where :                              *
*              - 1st char = C (color property)                  *
*              - 2nd char = color code (from 0 to 7)            *
*                                  0 = background color         *
*                                  1 = blue                     *
*                                  2 = gray                     *
*                                  3 = yellow                   *
*                                  4 = blue/gray                *
*                                  5 = green                    *
*                                  6 = red                      *
*                                  7 = orange                   *
*              - 3rd char = intensified (0=off, 1=on)           *
*              - 4th char = inverse display (0=off, 1=on)       *
* Colour overwriting priority :                                 *
*   1. Line                                                     *
*   2. Cell                                                     *
*   3. Column                                                   *
  DATA : w_position TYPE i VALUE '1'.
  CLEAR wa_fieldcat.
  MOVE w_position TO wa_fieldcat-col_pos.
  MOVE 'MATNR'    TO wa_fieldcat-fieldname.
  MOVE 'MARA'     TO wa_fieldcat-ref_table.
  MOVE 'MATNR'    TO wa_fieldcat-ref_field.
  APPEND wa_fieldcat TO it_fieldcat.
  ADD 1 TO w_position.
  CLEAR wa_fieldcat.
  MOVE w_position TO wa_fieldcat-col_pos.
  MOVE 'MATKL'    TO wa_fieldcat-fieldname.
  MOVE 'MARA'     TO wa_fieldcat-ref_table.
  MOVE 'MATKL'    TO wa_fieldcat-ref_field.
* Color column
  IF p_column = 'X'.
    MOVE 'C610'     TO wa_fieldcat-emphasize.
  ENDIF.
  APPEND wa_fieldcat TO it_fieldcat.
  ADD 1 TO w_position.
  CLEAR wa_fieldcat.
  MOVE w_position TO wa_fieldcat-col_pos.
  MOVE 'COUNTER'  TO wa_fieldcat-fieldname.
  MOVE 'N'        TO wa_fieldcat-inttype.
  MOVE '4'        TO wa_fieldcat-intlen.
  MOVE 'Counter'  TO wa_fieldcat-coltext.
  APPEND wa_fieldcat TO it_fieldcat.
  ADD 1 TO w_position.
  CLEAR wa_fieldcat.
  MOVE w_position  TO wa_fieldcat-col_pos.
  MOVE 'FREE_TEXT' TO wa_fieldcat-fieldname.
  MOVE 'C'         TO wa_fieldcat-inttype.
  MOVE '20'        TO wa_fieldcat-intlen.
  MOVE 'Text'      TO wa_fieldcat-coltext.
  APPEND wa_fieldcat TO it_fieldcat.
ENDFORM.                    " fill_catalog
*&      Form  fill_layout
*       text
*  -->  p1        text
*  <--  p2        text
FORM fill_layout.
* Field that identify color line in internal table
  MOVE 'COLOR_LINE' TO is_layout-info_fname.
* Field that identify cell color in inetrnal table
  MOVE 'COLOR_CELL' TO is_layout-ctab_fname.
ENDFORM.                    " fill_layout

Similar Messages

  • How to set background color in row of JTable ?

    i am new in java please tell me about How to set background color in row of JTable ? please example code. Thnak you.

    Here is an example: http://www.javaworld.com/javaworld/javaqa/2001-09/03-qa-0928-jtable.html
    For more info on how to use tables read the swing tutorial: http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
    ICE

  • How to set background color in af:inputText in an af:table

    Hi,
    how to set background color in af:inputText in an af:table depending on the value of af:inputText.
    For example, how to set background red if the af:inpuText is empty
    Thanks

    Hello Pavo,
    it's also possible to take the code from ebitar and use the expression within styleClass instead of inlineStyle.
    E.g. you can define a custom style "StyleClassEmptyText" in your skin and set this styleclass if af:inputtext is empty.
    By using style classes you can have the same style in the whole application and you are able to change this style on a single point(in the styleclass) for the whole application.
    br
    Peter

  • How to set background color for selected days in DateChooser

    How to set background color for selected days. I created
    checkbox for each day [Son,Mon,Tue,Wed,Thu,Fri,Sat] and a
    DateChooser, I want to change the background color for the selected
    day when i click on a button after selecting the desired checkboxs
    [ monthly wise/yearly wise]
    Thanks in advance

    There is no button involved in the following code, but it may
    be of use to you:
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="init()">
    <mx:Script>
    <![CDATA[
    private var origColor:uint;
    private function init():void {
    origColor = dc.getStyle("selectionColor");
    public function setBackGrdColors(newColor:uint):void {
    dc.setStyle("selectionColor", origColor);
    if(dc.selectedDate){
    var dayOfWeek:Number = dc.selectedDate.day;
    else{
    return;
    switch(dayOfWeek) {
    case 0:
    if(sun.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 1:
    if(mon.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 2:
    if(tue.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 3:
    if(wed.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 4:
    if(thu.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 5:
    if(fri.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 6:
    if(sat.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    default:
    break;
    ]]>
    </mx:Script>
    <mx:VBox horizontalAlign="center" verticalGap="20">
    <mx:DateChooser id="dc" textAlign="left"
    change="setBackGrdColors(cellColor.selectedColor)"/>
    <mx:HBox width="100%" horizontalAlign="center">
    <mx:CheckBox id="sun" label="Sun"/>
    <mx:CheckBox id="mon" label="Mon"/>
    <mx:CheckBox id="tue" label="Tue"/>
    <mx:CheckBox id="wed" label="Wed"/>
    </mx:HBox>
    <mx:HBox width="100%" horizontalAlign="center">
    <mx:CheckBox id="thu" label="Thu"/>
    <mx:CheckBox id="fri" label="Fri"/>
    <mx:CheckBox id="sat" label="Sat"/>
    </mx:HBox>
    <mx:HBox width="300" horizontalAlign="center">
    <mx:Label text="Background Color" />
    <mx:ColorPicker id="cellColor"
    selectedColor="#FF00FF"/>
    </mx:HBox>
    </mx:VBox>
    </mx:Application>

  • How to set background color in PL/SQL

    Hi,
    I have tried to set background color in SQL Query. When I execute in Report Region, I am not getting the background color.
    SELECT first query
    UNION 
    SELECT '   || v_sel_organization_id  || ' organization_id  FROM DUAL) org , hr_all_organization_units haou                          WHERE positions_set.position_id = allocations_set.position_id(+)              AND org.organization_id = positions_set.organization_id AND positions_set.position_id = encumbrance_set.enc_position_id(+)              AND positions_set.position_id = payclass_set.position_id(+)  AND org.organization_id = haou.organization_id AND TRUNC (SYSDATE) BETWEEN haou.date_from AND NVL (haou.date_to, TRUNC (SYSDATE))      AND (NVL (allocations_set.allocations, 0) + NVL (encumbrance_set.enc_count, 0) + NVL (payclass_set.pay_count, 0)) != 0  union  select  null , '' ''  ,'' '',''<SPAN STYLE="background-color: red;">Total</span>'' ,''' || v_sum_alloc ||''','|| v_sum_vac ||','''||  v_sum_encum ||''',''' || v_sum_pay ||''' ,null,null,null,null,2 from dual' ; Can anyone help me to resolve this issue.
    Regards
    Balaji S
    Edited by: Balaji Subramaniam on Jan 19, 2010 5:53 PM
    Edited by: Balaji Subramaniam on Jan 19, 2010 5:53 PM
    Edited by: Balaji Subramaniam on Jan 19, 2010 6:46 PM
    Edited by: Balaji Subramaniam on Jan 19, 2010 6:48 PM

    Hi
    A couple of things...
    Thats SQL - not PL/SQL
    That is not a valid SQL statement, I'm surprised its not giving an error. Please post the exact region source.
    When posting code on the forum, put {noformat}{noformat} (with the curly brackets and the word code in lowercase) above and below your code like this...
    {noformat}{noformat}
    SELECT *
    FROM emp
    {noformat}{noformat}
    It will then appear like this... SELECT *
    FROM emp
    Cheers
    Ben                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to set background color in JTF GRID

    Is it possible to set background color in JTF GRID ?

    Hello Pavo,
    it's also possible to take the code from ebitar and use the expression within styleClass instead of inlineStyle.
    E.g. you can define a custom style "StyleClassEmptyText" in your skin and set this styleclass if af:inputtext is empty.
    By using style classes you can have the same style in the whole application and you are able to change this style on a single point(in the styleclass) for the whole application.
    br
    Peter

  • How to set background color for a JFrame

    Hi,
    i am new to swing programming. I have created a JFrame called framehelp and i placed some labels in the frame.
    I have set the background color as yellow for the frame ie by setBackground(new java.awt.Color(255, 255, 204));
    But after compiling the program i am still getting the background color of frame as gray.
    How can i change the background color of frame as lightish yellow.
    I have used NETBEANS to generate this code and i am posting the code..
    Kindly help me
    Thanks in adavance
    public class framehelp extends javax.swing.JFrame {
        /** Creates new form framehelp */
        public framehelp() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        private void initComponents() {
            jLabel1 = new javax.swing.JLabel();
            jLabel2 = new javax.swing.JLabel();
            jLabel3 = new javax.swing.JLabel();
            jLabel4 = new javax.swing.JLabel();
            jLabel5 = new javax.swing.JLabel();
            jLabel6 = new javax.swing.JLabel();
            jLabel8 = new javax.swing.JLabel();
            jLabel9 = new javax.swing.JLabel();
            jLabel10 = new javax.swing.JLabel();
            jLabel11 = new javax.swing.JLabel();
            jLabel12 = new javax.swing.JLabel();
            jLabel13 = new javax.swing.JLabel();
            jLabel7 = new javax.swing.JLabel();
            jLabel14 = new javax.swing.JLabel();
            jLabel15 = new javax.swing.JLabel();
            jLabel16 = new javax.swing.JLabel();
            jLabel17 = new javax.swing.JLabel();
            jLabel18 = new javax.swing.JLabel();
            jLabel19 = new javax.swing.JLabel();
            jLabel20 = new javax.swing.JLabel();
            jLabel21 = new javax.swing.JLabel();
            jLabel22 = new javax.swing.JLabel();
            jLabel23 = new javax.swing.JLabel();
            jLabel24 = new javax.swing.JLabel();
            jLabel25 = new javax.swing.JLabel();
            jLabel26 = new javax.swing.JLabel();
            jLabel27 = new javax.swing.JLabel();
            jLabel28 = new javax.swing.JLabel();
            jLabel29 = new javax.swing.JLabel();
            jLabel30 = new javax.swing.JLabel();
            jLabel31 = new javax.swing.JLabel();
            jLabel32 = new javax.swing.JLabel();
            jLabel33 = new javax.swing.JLabel();
            getContentPane().setLayout(null);
            setBackground(new java.awt.Color(255, 255, 204));
            setForeground(new java.awt.Color(204, 204, 204));
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    exitForm(evt);
            jLabel1.setText("The CAME framework software measurement process evaluation is used to determine the Level of  measurement in the ITarea. This measurementprocess evaluation is ");
            getContentPane().add(jLabel1);
            jLabel1.setBounds(40, 50, 41, 16);
            jLabel2.setText("performed individually for software coomponents ie SoftwareProduct, SoftwareProcess and SoftwareResource.");
            getContentPane().add(jLabel2);
            jLabel2.setBounds(40, 70, 41, 16);
            jLabel3.setText("Below we describe the steps which will guide through the measurement process evaluation. There are two types of evaluation considerd here, General evaluation");
            getContentPane().add(jLabel3);
            jLabel3.setBounds(40, 100, 913, 16);
            jLabel4.setText("and Evaluation with respect to a standard. The measurement intensions considerd by varoius measurement standards will be used in our tool based method.  ");
            getContentPane().add(jLabel4);
            jLabel4.setBounds(40, 120, 893, 16);
            jLabel5.setText("Information about the measurement standards can be found at     www.iso.org ,    www.ieee.org.");
            getContentPane().add(jLabel5);
            jLabel5.setBounds(40, 140, 542, 16);
            jLabel6.setText("Steps to calculate the MetricsLevel");
            getContentPane().add(jLabel6);
            jLabel6.setBounds(40, 190, 199, 16);
            jLabel8.setText("2 )  The opened frame consists of several  metrics and measures, evaluation level buttons, result textfields and selection choice lists. To calculate");
            getContentPane().add(jLabel8);
            jLabel8.setBounds(70, 240, 41, 16);
            jLabel9.setText("general Metricslevel without any standard, select general from Measurement standard choice list. then select Both from scaleType choice list and finally select metrics ");
            getContentPane().add(jLabel9);
            jLabel9.setBounds(90, 260, 949, 16);
            jLabel10.setText(" and measures from the frame and press MetricsLevel Button. The metricslevel for the selected metrics will be displayed in textfield1.");
            getContentPane().add(jLabel10);
            jLabel10.setBounds(90, 280, 756, 16);
            jLabel11.setText("3 ) To determine MetricsLevel with respect to a standard select a standard from MeasurementStandard choice list, select Both from ScaleType choice list and finally ");
            getContentPane().add(jLabel11);
            jLabel11.setBounds(70, 300, 933, 16);
            jLabel12.setText("select darkened metrics and measures and press MetricsLevel Button. The Metrics Level for the selected Metrics and standard will be diplayed in textfield1.");
            getContentPane().add(jLabel12);
            jLabel12.setBounds(90, 320, 883, 16);
            jLabel13.setText("4 ) Repeat steps 1 2, 3  for ProcessMeasurementEvaluation and ResourceMeasurementEvaluation menu items from the select menu.");
            getContentPane().add(jLabel13);
            jLabel13.setBounds(70, 340, 751, 16);
            jLabel7.setText("1 ) Select ProductMeasurementEvaluation menu item from the select menu,a frame called CAME framework software product measurement evaluation will be opened. ");
            getContentPane().add(jLabel7);
            jLabel7.setBounds(70, 220, 946, 16);
            jLabel14.setText("Steps to calculate MeasurementLevel");
            getContentPane().add(jLabel14);
            jLabel14.setBounds(50, 390, 214, 16);
            jLabel15.setText("1 ) Select ProductMeasurementEvaluation menu item from the select menu,a frame called CAME framework software product measurement evaluation will be opened.");
            getContentPane().add(jLabel15);
            jLabel15.setBounds(80, 420, 943, 16);
            jLabel16.setText("2 ) The opened frame consists of several  metrics and measures, evaluation level buttons, result textfields and selection choice lists. To calculate");
            getContentPane().add(jLabel16);
            jLabel16.setBounds(80, 450, 822, 16);
            jLabel17.setText("general Measurementlevel without any standard, select general from Measurement standard choice list. then select Quantitative measures from scaleType choice list ");
            getContentPane().add(jLabel17);
            jLabel17.setBounds(100, 470, 943, 16);
            jLabel18.setText("and finally select metrics and measures from the frame and press MeasurementLevel Button. The MeasurementLevel for the selected metrics will be displayed in textfield2.");
            getContentPane().add(jLabel18);
            jLabel18.setBounds(100, 490, 973, 20);
            jLabel19.setText("3 ) To determine MeasurementLevel with respect to a standard select a standard from MeasurementStandard choice list, select Quantitative measures from ScaleType choice list");
            getContentPane().add(jLabel19);
            jLabel19.setBounds(80, 510, 1009, 16);
            jLabel20.setText("and finally select darkened metrics and measures and press MeasurementLevel Button. The MeasurementLevel  will be diplayed in textfield2.");
            getContentPane().add(jLabel20);
            jLabel20.setBounds(100, 530, 799, 16);
            jLabel21.setText("4 )Repeat steps 1 2, 3  for ProcessMeasurementEvaluation and ResourceMeasurementEvaluation menu items from the select menu.");
            getContentPane().add(jLabel21);
            jLabel21.setBounds(80, 550, 748, 16);
            jLabel22.setText("Steps to calculate MeasurementProcessLevel");
            getContentPane().add(jLabel22);
            jLabel22.setBounds(50, 600, 262, 16);
            jLabel23.setText("1 ) Select ProductMeasurementEvaluation menu item from the select menu,a frame called CAME framework software product measurement evaluation will be opened.");
            getContentPane().add(jLabel23);
            jLabel23.setBounds(80, 630, 943, 16);
            jLabel24.setText("2 )The opened frame consists of several  metrics and measures, evaluation level buttons, result textfields and selection choice lists. To calculate");
            getContentPane().add(jLabel24);
            jLabel24.setBounds(80, 650, 819, 16);
            jLabel25.setText("general MeasurementProcesslevel without any standard, select general from Measurement standard choice list. then select Quantitative measures from scaleType ");
            getContentPane().add(jLabel25);
            jLabel25.setBounds(100, 670, 930, 16);
            jLabel26.setText("choice list, enter migrated metrics if any in textfield  below migrated metrics label and finally select metrics measures from the frame and press ");
            getContentPane().add(jLabel26);
            jLabel26.setBounds(100, 690, 818, 16);
            jLabel27.setText("MeasurementProcessLevel Button. The MeasurementProcessLevel for the selected metrics will be displayed in textfield3.");
            getContentPane().add(jLabel27);
            jLabel27.setBounds(100, 710, 691, 16);
            jLabel28.setText("3 ) To determine MeasurementProcessLevel with respect to a standard select a standard from MeasurementStandard choice list, select Quantitative measures from ");
            getContentPane().add(jLabel28);
            jLabel28.setBounds(80, 740, 937, 16);
            jLabel29.setText("from ScaleType choice list, enter migrated metrics if any in textfield below migrated metrics and finally select darkened metrics and measures and press  ");
            getContentPane().add(jLabel29);
            jLabel29.setBounds(100, 760, 873, 16);
            jLabel30.setText("MeasurementProcessLevel Button. The MeasurementprocessLevel for the selected metrics will be displayed in textfield3");
            getContentPane().add(jLabel30);
            jLabel30.setBounds(100, 780, 687, 16);
            jLabel31.setText("4 ) Repeat steps 1,2,3 for ProcessMeasurementEvaluation and ResourceMeasurementEvaluation menuitems.");
            getContentPane().add(jLabel31);
            jLabel31.setBounds(80, 800, 618, 16);
            jLabel32.setText("Steps to calculate MeasuredSoftwareProcessLevl");
            getContentPane().add(jLabel32);
            jLabel32.setBounds(60, 830, 285, 16);
            jLabel33.setText("1 ) Follow the same steps as MetricsLevel calcualtion but select metrics and measures covered by CAME Tools only.");
            getContentPane().add(jLabel33);
            jLabel33.setBounds(90, 860, 657, 16);
            java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
            setBounds((screenSize.width-1100)/2, (screenSize.height-940)/2, 1100, 940);
        /** Exit the Application */
        private void exitForm(java.awt.event.WindowEvent evt) {
            System.exit(0);
         * @param args the command line arguments
        public static void main(String args[]) {
            new framehelp().show();
        // Variables declaration - do not modify
        private javax.swing.JLabel jLabel1;
        private javax.swing.JLabel jLabel10;
        private javax.swing.JLabel jLabel11;
        private javax.swing.JLabel jLabel12;
        private javax.swing.JLabel jLabel13;
        private javax.swing.JLabel jLabel14;
        private javax.swing.JLabel jLabel15;
        private javax.swing.JLabel jLabel16;
        private javax.swing.JLabel jLabel17;
        private javax.swing.JLabel jLabel18;
        private javax.swing.JLabel jLabel19;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JLabel jLabel20;
        private javax.swing.JLabel jLabel21;
        private javax.swing.JLabel jLabel22;
        private javax.swing.JLabel jLabel23;
        private javax.swing.JLabel jLabel24;
        private javax.swing.JLabel jLabel25;
        private javax.swing.JLabel jLabel26;
        private javax.swing.JLabel jLabel27;
        private javax.swing.JLabel jLabel28;
        private javax.swing.JLabel jLabel29;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JLabel jLabel30;
        private javax.swing.JLabel jLabel31;
        private javax.swing.JLabel jLabel32;
        private javax.swing.JLabel jLabel33;
        private javax.swing.JLabel jLabel4;
        private javax.swing.JLabel jLabel5;
        private javax.swing.JLabel jLabel6;
        private javax.swing.JLabel jLabel7;
        private javax.swing.JLabel jLabel8;
        private javax.swing.JLabel jLabel9;
        // End of variables declaration
    }

    1. When you post code, post a minimal example. Did we have to scroll through
    all those bloody labels.
    2. Can't say much for the quality of code NetBeans generates.
    3. To answer your question (sorry, I don't have an autographed copy of the photo):
    import java.awt.*;
    import java.net.*;
    import javax.swing.*;
    public class Example {
        public static void main(String[] args) throws MalformedURLException {
            final JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            Container cp = f.getContentPane();
            cp.setBackground(new Color(0xff, 0xff, 0xee));
            cp.add(new JLabel("set the color on the content pane, not the frame"), BorderLayout.SOUTH);
            URL url = new URL("http://today.java.net/jag/bio/JagHeadshot-small.jpg");
            cp.add(new JLabel(new ImageIcon(url)));
            f.pack();
            SwingUtilities.invokeLater(new Runnable(){
                public void run() {
                    f.setLocationRelativeTo(null);
                    f.setVisible(true);
    }

  • Spark VideoDisplay - how to set `background` color

    Hello!
    How can I set the background color of the Spark VideoDisplay to be something else than the default black one?
    Thank you.

    There is no button involved in the following code, but it may
    be of use to you:
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="init()">
    <mx:Script>
    <![CDATA[
    private var origColor:uint;
    private function init():void {
    origColor = dc.getStyle("selectionColor");
    public function setBackGrdColors(newColor:uint):void {
    dc.setStyle("selectionColor", origColor);
    if(dc.selectedDate){
    var dayOfWeek:Number = dc.selectedDate.day;
    else{
    return;
    switch(dayOfWeek) {
    case 0:
    if(sun.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 1:
    if(mon.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 2:
    if(tue.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 3:
    if(wed.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 4:
    if(thu.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 5:
    if(fri.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 6:
    if(sat.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    default:
    break;
    ]]>
    </mx:Script>
    <mx:VBox horizontalAlign="center" verticalGap="20">
    <mx:DateChooser id="dc" textAlign="left"
    change="setBackGrdColors(cellColor.selectedColor)"/>
    <mx:HBox width="100%" horizontalAlign="center">
    <mx:CheckBox id="sun" label="Sun"/>
    <mx:CheckBox id="mon" label="Mon"/>
    <mx:CheckBox id="tue" label="Tue"/>
    <mx:CheckBox id="wed" label="Wed"/>
    </mx:HBox>
    <mx:HBox width="100%" horizontalAlign="center">
    <mx:CheckBox id="thu" label="Thu"/>
    <mx:CheckBox id="fri" label="Fri"/>
    <mx:CheckBox id="sat" label="Sat"/>
    </mx:HBox>
    <mx:HBox width="300" horizontalAlign="center">
    <mx:Label text="Background Color" />
    <mx:ColorPicker id="cellColor"
    selectedColor="#FF00FF"/>
    </mx:HBox>
    </mx:VBox>
    </mx:Application>

  • How to set background color of row in JTable

    Hi,I want to set different background color to rows in JTable according to some value in the this row.
    eg.
    no name isGood
    1 aaa yes (this row's background color is red)
    2 bbb no (this row's background color is blue)
    3 ccc yes (this row's background color is red)
    4 ddd yes (this row's background color is red)
    5 eee no (this row's background color is blue)
    thanks

    thanks!*_*                                                                                                                                                                                                                                                       

  • How to set background color in a scene?

    I'm new to JavaFX and just started my first FX program.  I created an FX project in NetBeans 7.3 and the project runs properly.   All of the samples in the JavaFX samples download run as well.  But when I try to do something as simple as setting the background color on my first scene to black, I can't get it to work.  I find examples and documentation that tell me that what I am doing should work but it does not. 
            Scene scene = new Scene(root, 300, 250, Color.BLACK);
            scene.setFill(Color.BLACK);
            primaryStage.initStyle(StageStyle.UNDECORATED);
            primaryStage.setTitle("Hello World!");
            primaryStage.setScene(scene);
    The two bold lines are marked as errors.  Unfortunately, I can't find a way to copy the error popup text in the IDE so I'll summarize.  Both lines are giving errors that say that I gave a Color but a Paint was expected.
    Is there something I am missing? Can it be this hard to set a background color in JavaFX?
    Thanks.

    Hi. Check your imports. You probably have
    import java.awt.Color;
    instead of
    import javafx.scene.paint.Color;

  • How to set background color based on values in column grouping

    Hello,
    I have query
    select 1 as CustomerID,'Reality' as Type, 100 as Turnover
    UNION
    select 1 as CustomerID,'Budget' as Type, 120 as Turnover
    UNION
    select 2 as CustomerID,'Reality' as Type, 140 as Turnover
    UNION
    select 2 as CustomerID,'Budget' as Type, 120 as Turnover
    I have matrix, where in rows are customers, there is columngroup based on field Type and in details are summaries of Turnover. I need to change background color of Reality field, when lower than Budget. How can I do that please ?

    Hi volyn,
    After testing the issue in my own environment, we can use custom code to achieve your requirement. For more details, you can refer to the following steps:
    Copy the custom code below and paste it to your report. (Right-click report>Report Properties>Code)
    DIM PreviousValue AS Decimal
    Dim CustomerID AS String = ""
    Public Function  GetPreviousValue(byval Val as Decimal, byval CusID as string)  as Decimal
    DIM Local_PreviousValue AS Decimal
    IF CustomerID <> CusID THEN
    CustomerID  = CusID 
    PreviousValue  = val
    Local_PreviousValue  = 0
    ELSE
    Local_PreviousValue =  val - PreviousValue 
    PreviousValue  = val
    END IF
    return Local_PreviousValue 
    End function
    Click the cell which contains [Sum(Turnover)] value, modify the expression of BackgroundColor property to like this in the Properties Window: 
    =iif(Code.GetPreviousValue(Fields!Turnover.Value,Fields!CustomerID.Value)<0,"Brown","White")
    In this scenario, you can change Brown color to any color you like. The following screenshot is for your reference (I added some data to make it more clearly):
    If you have any other questions, please feel free to ask.
    Thanks, 
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to set background color for textarea

    Hi all,
    I have created an application in Apex 3.2.
    I am now able to disable the text fields, select lists and textarea.
    Ex:
    function disableDD()
      var v_ddays              = document.getElementById("P2_DELINQUENCY_DAYS");
      v_ddays.value            = "";
      v_ddays.disabled         = true;
      v_ddays.style.background = '#cccccc';
    }The background color thing is working for all the text fields, but the same is not working with the textarea.
    Any help please....

    There is no button involved in the following code, but it may
    be of use to you:
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="init()">
    <mx:Script>
    <![CDATA[
    private var origColor:uint;
    private function init():void {
    origColor = dc.getStyle("selectionColor");
    public function setBackGrdColors(newColor:uint):void {
    dc.setStyle("selectionColor", origColor);
    if(dc.selectedDate){
    var dayOfWeek:Number = dc.selectedDate.day;
    else{
    return;
    switch(dayOfWeek) {
    case 0:
    if(sun.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 1:
    if(mon.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 2:
    if(tue.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 3:
    if(wed.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 4:
    if(thu.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 5:
    if(fri.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 6:
    if(sat.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    default:
    break;
    ]]>
    </mx:Script>
    <mx:VBox horizontalAlign="center" verticalGap="20">
    <mx:DateChooser id="dc" textAlign="left"
    change="setBackGrdColors(cellColor.selectedColor)"/>
    <mx:HBox width="100%" horizontalAlign="center">
    <mx:CheckBox id="sun" label="Sun"/>
    <mx:CheckBox id="mon" label="Mon"/>
    <mx:CheckBox id="tue" label="Tue"/>
    <mx:CheckBox id="wed" label="Wed"/>
    </mx:HBox>
    <mx:HBox width="100%" horizontalAlign="center">
    <mx:CheckBox id="thu" label="Thu"/>
    <mx:CheckBox id="fri" label="Fri"/>
    <mx:CheckBox id="sat" label="Sat"/>
    </mx:HBox>
    <mx:HBox width="300" horizontalAlign="center">
    <mx:Label text="Background Color" />
    <mx:ColorPicker id="cellColor"
    selectedColor="#FF00FF"/>
    </mx:HBox>
    </mx:VBox>
    </mx:Application>

  • How to set background color of a visio object depending on it's text

    Hello everyone,
    I am an application developer and use visio to outline process flows.
    For one visio file that I have inherited, process objects are used to represent different process group on our system. Each type of process group contain common words in the text, e.g. 'data source', 'Email', 'Data Model'.
    There are 7 visio sheets each containing several charts.
    I would like to apply a common backgroud color to specific group of objects for e.g. blue background to all visio process objects that contain the text '(Data Model)'.
    I have googled and searched the MSDN forum but without any solution so far.
    Any advice or suggestion from anyone would be most welcomed and much appreciated.
    Thank you for reading and replying.
    kind rgds

    Please try out the below macro. Replace the color with whatever value you want.
    This will iterate through all shapes in all pages in all the documents and set the foreground color of the shape with a particular color depending on the shape text.
    Sub Macro1()
    Dim document As Integer
    Dim pagecount As Integer
    Dim shapecount As Integer
    For document = 1 To Application.Documents.Count
    For pagecount = 1 To Documents(document).Pages.Count
    For shapecount = 1 To Documents(document).Pages(pagecount).Shapes.Count
    If Documents(document).Pages(pagecount).Shapes(shapecount).Text = "data source" Then
    Documents(document).Pages(pagecount).Shapes(shapecount).CellsSRC(visSectionObject, visRowFill, visFillForegnd).FormulaU = 4
    ElseIf Documents(document).Pages(pagecount).Shapes(shapecount).Text = "Email" Then
    Documents(document).Pages(pagecount).Shapes(shapecount).CellsSRC(visSectionObject, visRowFill, visFillForegnd).FormulaU = 3
    ElseIf Documents(document).Pages(pagecount).Shapes(shapecount).Text = "Data Model" Then
    Documents(document).Pages(pagecount).Shapes(shapecount).CellsSRC(visSectionObject, visRowFill, visFillForegnd).FormulaU = 2
    End If
    Next shapecount
    Next pagecount
    Next document
    End Sub
    Let me know if you face any issues

  • Set background color when condition applied

    hi,
    Can anybody tell me how to set background color when condition applied.
    My initial plan was to highlight a specify row(Change color) when the third column of this JTable consists of OK word.
    int rowCount = table.getRowCount();
    for(int i=0 ;i <rowCount ; i++)
    String word = table.getValueAt(i,3).toString();
    if(word.equals("Word")) {
    table.setSelectionBackground(Color.red);
    break;
    else {
    table.setBackground(getBackground());
    Thanks.

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.*;
    public class TableChanges
        public TableChanges()
            String[] headers = { "column 1", "column 2", "column 3", "column 4" };
            int rows = 18;
            int cols = 4;
            String[][] data = new String[rows][cols];
            for(int row = 0; row < rows; row++)
                for(int col = 0; col < cols; col++)
                    data[row][col] = "item " + (row * cols + col + 1);
            JTable table = new JTable(data, headers);
            // add custom cell renderer to each column
            TableColumnModel columnModel = table.getColumnModel();
            for(int j = 0; j < columnModel.getColumnCount(); j++)
                TableColumn col = columnModel.getColumn(j);
                col.setCellRenderer(new CellRenderer());
            // add table model listener to listen for cell edits
            // so we can detect our special selection edit value
            // which is "word"
            TableModel tableModel = table.getModel();
            tableModel.addTableModelListener(new ModelListener(table));
            JScrollPane scrollPane = new JScrollPane(table);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(scrollPane);
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
            Dimension d = scrollPane.getViewport().getSize();
            table.setRowHeight(d.height/rows);
        public static void main(String[] args)
            new TableChanges();
    class ModelListener implements TableModelListener
        JTable table;
        public ModelListener(JTable table)
            this.table = table;
        public void tableChanged(TableModelEvent e)
            int firstRow = e.getFirstRow();
            int lastRow  = e.getLastRow();
            int colIndex = e.getColumn();
            if(e.getType() == TableModelEvent.UPDATE &&
                  firstRow != TableModelEvent.HEADER_ROW &&
                  colIndex != TableModelEvent.ALL_COLUMNS &&
                  colIndex == 2)                            // column 3 only
                String value = (String)table.getValueAt(firstRow, colIndex);
                // check for our special selection criteria
                if(value.equals("word"))
                    for(int j = 0; j < table.getColumnCount(); j++)
                        CellRenderer renderer =
                            (CellRenderer)table.getCellRenderer(firstRow, j);
                        renderer.setSpecialSelection(firstRow, j);
    class CellRenderer extends DefaultTableCellRenderer
        int specRow, specCol;
        public CellRenderer()
            specRow = -1;
            specCol = -1;
        public Component getTableCellRendererComponent(JTable table,
                                                       Object value,
                                                       boolean isSelected,
                                                       boolean hasFocus,
                                                       int row, int col)
            setHorizontalAlignment(JLabel.CENTER);
            Color color = Color.black;
            if(hasFocus)
                color = Color.blue;
            else if(isSelected)
                color = Color.green.darker();
            else if(row == specRow && col == specCol)
                color = color.red;
            setForeground(color);
            setText((String)value);
            return this;
        public void setSpecialSelection(int row, int col)
            specRow = row;
            specCol = col;
    }

  • 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

Maybe you are looking for