RadioButton Color

Hello
I making 3 radio buttons each one is given a color name red green and yellow. I have the button made and labled but how do i make the button color. Can radio buttons be colored or can they only be solid black? For example the Red button would be red when picked. I also dont know color codes. I only have codes for fillig in color if you were to draw something in a field. Im using bluej.
Thanks
Rewind

Here is my code so far. I just need to make the buttons change colors when there clicked.
Thanks Again
Rewind
import java.awt.*;
import java.awt.event.*;
public class Colors extends JFrame
private String[] text;
private JLabel quote;
private JRadioButton green, red, yellow;
private ButtonGroup topic;
private JPanel domain, app;
public Colors()
super("Colors");
setSize(300, 150);
green = new JRadioButton ("GREEN", true);
red = new JRadioButton ("RED", false);
yellow = new JRadioButton ("YELLOW", false);
topic = new ButtonGroup();
topic.add (green);
topic.add (red);
topic.add (yellow);
domain = new JPanel();
domain.setLayout (new BoxLayout (domain, BoxLayout.Y_AXIS));
domain.add (green);
domain.add (red);
domain.add (yellow);
app = new JPanel();
app.setLayout (new BorderLayout(15,10));
app.add (domain, BorderLayout.CENTER);
setContentPane (app);

Similar Messages

  • Problem with TextInput and RadioButton

    Hi,
    I've encountered a problem with TextInput and RadioButtons.
    I've created some text fields and radio buttons for a
    feedback form under a movie _root.feedback.
    But for some reason, I can't seem to enter text into the text
    field (no blinking cursor), and I can't see the "label" next to my
    radio buttons.
    Just as a workaround, I tried moving these fields to _root,
    and now I can enter text and see the radio button labels.
    But to keep my hierarchy clean, I want to use a the
    _root.feedback movie for my feedback fields. Any ideas what could
    be going wrong? I checked Window -> Component Inspector, and
    these textInput fields are enabled.
    Stuck.
    Thanks.

    Is the text the same color as the background or do you need
    embedded fonts?

  • Adding color to few rows in ALV report output

    Hi,
    I have developed a ALV report program which displays the project details of the employees.In the output the rows containing the employees who have been part of the project should be displayed in different color.I have used necessary code for this but still the rows are not displayed in different color.
    Given below is my program.Please suggest me possible solution for this.
    REPORT  ZPROJ_ALL_DETAILS.
    TYPE-POOLS: SLIS.
    Tables: zheempl,zhealoc,zheproj,zheskil.
    types: begin of ty_zheempl,
          empid like zheempl-empid,
          grade like zheempl-grade,
          location like zheempl-location,
          pu like zheempl-pu,
          name1 like zheempl-name1,
          end of ty_zheempl.
    types: begin of ty_zhealoc,
          project like zhealoc-project,
          stdat like zhealoc-stdat,
          endat like zhealoc-endat,
          role like zhealoc-role,
          end of ty_zhealoc.
    types: begin of ty_output,
          empid like zheempl-empid,
          grade like zheempl-grade,
          location like zheempl-location,
          pu    like zheempl-pu,
          name1 like zheempl-name1,
          role like zhealoc-role,
          stdat like zhealoc-stdat,
          endat like zhealoc-endat,
          cellcolor(4) type c,
          end of ty_output.
    data: t_zheempl type standard table of ty_zheempl,
          t_zhealoc type standard table of ty_zhealoc,
          t_output type standard table of ty_output with header line.
    data: wa_zheempl type ty_zheempl,
          wa_zhealoc type ty_zhealoc,
          wa_output type ty_output.
    DATA : T_FIELDCAT TYPE slis_t_fieldcat_alv.
    Data : wa_fieldcat type slis_fieldcat_alv.
    Data: it_top TYPE slis_t_listheader,
          wa_top TYPE slis_listheader.
    Data: t_cellcolor TYPE lvc_t_scol WITH HEADER LINE,
          wa_cellcolor TYPE lvc_s_scol.
    Data: t_layout TYPE slis_layout_alv.
    *selection-screen
    selection-screen: begin of block b1 with frame title text-001.
    select-options: s_proj for wa_zhealoc-project,
                    s_empid   for wa_zheempl-empid.
    parameters:     p_date like sy-datum obligatory.
    selection-screen: end of block b1.
    selection-screen: begin of block b2 with frame title text-002.
    parameters:      p_prtosr  radiobutton group g1 default 'X',
                     p_prusly  radiobutton group g1.
    selection-screen: end of block b2.
    selection-screen: begin of block b3 with frame title text-003.
    parameters:      p_dwtodk as checkbox default 'X'.
    selection-screen: end of block b3.
    selection-screen: begin of block b4 with frame title text-004.
    parameters:      p_shwhis as checkbox default 'X'.
    selection-screen: end of block b4.
    Start-of-selection
      IF p_shwhis = 'X'.
    SELECT l~empid
           l~grade
           l~location
           l~pu
           l~name1
           c~role
           c~stdat
           c~endat
      INTO TABLE t_output
      FROM ( zheempl AS l
      INNER JOIN zhealoc
      AS c ON lempid = cempid )
      where project IN s_proj
      AND endat < p_date
      OR endat > p_date.
       t_output-cellcolor = 'C310'.
       MODIFY t_output transporting cellcolor where endat < p_date.
      ELSE.
      select l~empid
           l~grade
           l~location
           l~pu
           l~name1
           c~role
           c~stdat
           c~endat
      INTO TABLE t_output
      FROM ( zheempl AS l
      INNER JOIN zhealoc
      AS c ON lempid = cempid )
      WHERE project in s_proj
      AND   endat > p_date.
       ENDIF.
      wa_fieldcat-col_pos = '1'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'EMPID'.
      wa_fieldcat-seltext_m = 'Employee ID'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '2'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'NAME1'.
      wa_fieldcat-seltext_m = 'Name 1'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '3'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'ROLE'.
      wa_fieldcat-seltext_m = 'Role of employee in the project'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '4'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'STDAT'.
      wa_fieldcat-seltext_m = 'Start Date'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '5'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'ENDAT'.
      wa_fieldcat-seltext_m = 'End Date'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '6'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'GRADE'.
      wa_fieldcat-seltext_m = 'Salary Level'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '7'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'PU'.
      wa_fieldcat-seltext_m = 'Department Number'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '8'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'LOCATION'.
      wa_fieldcat-seltext_m = 'Work Location'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      t_layout-no_input = 'X'.
      t_layout-colwidth_optimize = 'x'.
      t_layout-info_fieldname = 'LINE_COLOR'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
        I_INTERFACE_CHECK                 = ' '
        I_BYPASSING_BUFFER                = ' '
        I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                = SY-REPID
         i_callback_top_of_page            = 'TOP'
         is_layout                         = t_layout
         IT_FIELDCAT                       = T_FIELDCAT
         i_save                            = 'X'
        TABLES
          t_outtab                          = T_OUTPUT
      EXCEPTIONS
        PROGRAM_ERROR                     = 1
        OTHERS                            = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Form top.
      Refresh it_top.
      wa_top-typ = 'S'.
      wa_top-key = 'Requestor'.
      wa_top-info = sy-uname.
      APPEND wa_top to it_top.
      CLEAR wa_top.
      wa_top-typ = 'S'.
      wa_top-key = 'Program'.
      wa_top-info = sy-repid.
      APPEND wa_top to it_top.
      CLEAR wa_top.
      wa_top-typ = 'S'.
      wa_top-key = 'Page'.
      wa_top-info = sy-pagno.
      APPEND wa_top to it_top.
      CLEAR wa_top.
      wa_top-typ = 'S'.
      wa_top-key = 'Date'.
      wa_top-info = sy-datum.
      APPEND wa_top to it_top.
      CLEAR wa_top.
      wa_top-typ = 'H'.
      wa_top-info = 'Project Details'.
      APPEND wa_top to it_top.
      CLEAR wa_top.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary       = it_top.
      ENDFORM.

    { REPORT  ZPROJ_ALL_DETAILS.
    TYPE-POOLS: SLIS.
    Tables: zheempl,zhealoc,zheproj,zheskil.
    types: begin of ty_zheempl,
          empid like zheempl-empid,
          grade like zheempl-grade,
          location like zheempl-location,
          pu like zheempl-pu,
          name1 like zheempl-name1,
          end of ty_zheempl.
    types: begin of ty_zhealoc,
          project like zhealoc-project,
          stdat like zhealoc-stdat,
          endat like zhealoc-endat,
          role like zhealoc-role,
          end of ty_zhealoc.
    types: begin of ty_output,
          empid like zheempl-empid,
          grade like zheempl-grade,
          location like zheempl-location,
          pu    like zheempl-pu,
          name1 like zheempl-name1,
          role like zhealoc-role,
          stdat like zhealoc-stdat,
          endat like zhealoc-endat,
          cellcolor(4) type c,
          end of ty_output.
    data: t_zheempl type standard table of ty_zheempl,
          t_zhealoc type standard table of ty_zhealoc,
          t_output type standard table of ty_output with header line,
          t_output1 type standard table of ty_output with header line.
    data: wa_zheempl type ty_zheempl,
          wa_zhealoc type ty_zhealoc,
          wa_output type ty_output,
          wa_output1 type ty_output.
    DATA : T_FIELDCAT TYPE slis_t_fieldcat_alv.
    Data : wa_fieldcat type slis_fieldcat_alv.
    Data: it_top TYPE slis_t_listheader,
          wa_top TYPE slis_listheader.
    Data: t_cellcolor TYPE lvc_t_scol WITH HEADER LINE,
          wa_cellcolor TYPE lvc_s_scol.
    Data: t_layout TYPE slis_layout_alv.
    *selection-screen
    selection-screen: begin of block b1 with frame title text-001.
    select-options: s_proj for wa_zhealoc-project,
                    s_empid   for wa_zheempl-empid.
    parameters:     p_date like sy-datum obligatory.
    selection-screen: end of block b1.
    selection-screen: begin of block b2 with frame title text-002.
    parameters:      p_prtosr  radiobutton group g1 default 'X',
                     p_prusly  radiobutton group g1.
    selection-screen: end of block b2.
    selection-screen: begin of block b3 with frame title text-003.
    parameters:      p_dwtodk as checkbox default 'X'.
    selection-screen: end of block b3.
    selection-screen: begin of block b4 with frame title text-004.
    parameters:      p_shwhis as checkbox default 'X'.
    selection-screen: end of block b4.
    Start-of-selection
      IF p_shwhis = 'X'.
    SELECT l~empid
           l~grade
           l~location
           l~pu
           l~name1
           c~role
           c~stdat
           c~endat
      INTO TABLE t_output
      FROM ( zheempl AS l
      INNER JOIN zhealoc
      AS c ON lempid = cempid )
      where project IN s_proj
      AND endat < p_date
      OR endat > p_date.
       t_output-cellcolor = 'C310'.
       MODIFY t_output transporting cellcolor where endat < p_date.
      ELSE.
      select l~empid
           l~grade
           l~location
           l~pu
           l~name1
           c~role
           c~stdat
           c~endat
      INTO TABLE t_output
      FROM ( zheempl AS l
      INNER JOIN zhealoc
      AS c ON lempid = cempid )
      WHERE project in s_proj
      AND   endat > p_date.
       ENDIF.
      wa_fieldcat-col_pos = '1'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'EMPID'.
      wa_fieldcat-seltext_m = 'Employee ID'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '2'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'NAME1'.
      wa_fieldcat-seltext_m = 'Name 1'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '3'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'ROLE'.
      wa_fieldcat-seltext_m = 'Role of employee in the project'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '4'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'STDAT'.
      wa_fieldcat-seltext_m = 'Start Date'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '5'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'ENDAT'.
      wa_fieldcat-seltext_m = 'End Date'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '6'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'GRADE'.
      wa_fieldcat-seltext_m = 'Salary Level'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '7'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'PU'.
      wa_fieldcat-seltext_m = 'Department Number'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '8'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'LOCATION'.
      wa_fieldcat-seltext_m = 'Work Location'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      t_layout-no_input = 'X'.
      t_layout-colwidth_optimize = 'x'.
      t_layout-info_fieldname = 'LINE_COLOR'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
        I_INTERFACE_CHECK                 = ' '
        I_BYPASSING_BUFFER                = ' '
        I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                = SY-REPID
         i_callback_top_of_page            = 'TOP'
         is_layout                         = t_layout
         IT_FIELDCAT                       = T_FIELDCAT
         i_save                            = 'X'
        TABLES
          t_outtab                          = T_OUTPUT
      EXCEPTIONS
        PROGRAM_ERROR                     = 1
        OTHERS                            = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Form top.
      Refresh it_top.
      wa_top-typ = 'S'.
      wa_top-key = 'Requestor'.
      wa_top-info = sy-uname.
      APPEND wa_top to it_top.
      CLEAR wa_top.
      wa_top-typ = 'S'.
      wa_top-key = 'Program'.
      wa_top-info = sy-repid.
      APPEND wa_top to it_top.
      CLEAR wa_top.
      wa_top-typ = 'S'.
      wa_top-key = 'Page'.
      wa_top-info = sy-pagno.
      APPEND wa_top to it_top.
      CLEAR wa_top.
      wa_top-typ = 'S'.
      wa_top-key = 'Date'.
      wa_top-info = sy-datum.
      APPEND wa_top to it_top.
      CLEAR wa_top.
      wa_top-typ = 'H'.
      wa_top-info = 'Project Details'.
      APPEND wa_top to it_top.
      CLEAR wa_top.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary       = it_top.
      ENDFORM.}

  • Coloring of a (specific) row in ALV report-How?

    Hi Experts,
    Am looking to assign a color for a (specific)row in ALV report.......so, pls. let me know How to get it done?
    thanq

    TABLES:LFA1.
    SELECT-OPTIONS:LIFNR FOR LFA1-LIFNR.
    DATA:BEGIN OF ITAB OCCURS 0,
    LIFNR LIKE LFA1-LIFNR,
    NAME1 LIKE LFA1-NAME1,
    LAND1 LIKE LFA1-LAND1,
    ORT01 LIKE LFA1-ORT01,
    REGIO LIKE LFA1-REGIO,
    SORTL LIKE LFA1-SORTL,
    CFIELD(4) TYPE C,
    END OF ITAB.
    data:col(4).
    data:num value '1'.
    SELECT * FROM LFA1 INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE LIFNR
    IN LIFNR.
    LOOP AT ITAB.
    concatenate 'C' num '10' into col .
    ITAB-CFIELD = col.
    num = num + 1.
    if num = '8'.
    num = '1'.
    endif.
    MODIFY ITAB.
    ENDLOOP.
    TYPE-POOLS:SLIS.
    DATA:FCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA:LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA:SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE.
    DATA:EVE TYPE SLIS_T_EVENT WITH HEADER LINE.
    LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    LAYOUT-WINDOW_TITLEBAR = 'VENDORS DETAILS SCREEN'.
    LAYOUT-EDIT = 'X'.
    LAYOUT-info_fieldname = 'CFIELD'.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    I_PROGRAM_NAME = SY-REPID
    I_INTERNAL_TABNAME = 'ITAB'
    I_INCLNAME = SY-REPID
    CHANGING
    CT_FIELDCAT = FCAT.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FCAT
    TABLES
    T_OUTTAB = ITAB.
    this is for coloring cols
    REPORT ZBHCOLOR_COLS.
    TABLES:LFA1.
    SELECT-OPTIONS:C_LIFNR FOR LFA1-LIFNR. " FOR GRID ONLY
    PARAMETERS:LIST RADIOBUTTON GROUP ALV DEFAULT 'X',
    GRID RADIOBUTTON GROUP ALV.
    DATA:BEGIN OF ITAB OCCURS 0,
    LIFNR LIKE LFA1-LIFNR,
    NAME1 LIKE LFA1-NAME1,
    LAND1 LIKE LFA1-LAND1,
    ORT01 LIKE LFA1-ORT01,
    SORTL LIKE LFA1-SORTL,
    REGIO LIKE LFA1-REGIO,
    COL TYPE LVC_T_SCOL,
    END OF ITAB.
    DATA:COLR TYPE LVC_S_SCOL.
    SELECT * FROM LFA1 INTO CORRESPONDING FIELDS OF TABLE ITAB.
    LOOP AT ITAB.
    IF ITAB-LIFNR IN C_LIFNR.
    COLR-FNAME = 'NAME1'.
    COLR-COLOR-COL = '5'.
    COLR-COLOR-INT = '1'.
    COLR-COLOR-INV = '0'.
    COLR-NOKEYCOL = 'X'.
    APPEND COLR TO ITAB-COL.
    COLR-FNAME = 'LIFNR'.
    APPEND COLR TO ITAB-COL.
    MODIFY ITAB.
    ENDIF.
    ENDLOOP.
    TYPE-POOLS:SLIS.
    DATA:FCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA:LAYOUT TYPE SLIS_LAYOUT_ALV.
    LAYOUT-ZEBRA = 'X'.
    layout-coltab_fieldname = 'COL'.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    I_PROGRAM_NAME = SY-REPID
    I_INTERNAL_TABNAME = 'ITAB'
    I_INCLNAME = SY-REPID
    CHANGING
    CT_FIELDCAT = FCAT.
    IF LIST = 'X'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FCAT
    TABLES
    T_OUTTAB = ITAB.
    ELSEIF GRID = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FCAT
    TABLES
    T_OUTTAB = ITAB.
    ENDIF.
    Reward points if useful.

  • How to color row in ALV report?

    hi
    I am creating an ALV report using factory method.
    my report is based on itab which contain 3 coulms, 1 column is ERROR_TYPE . how can i color all the rows which contain E in error_type ???
    thanks
    Ami

    TABLES:LFA1.
    SELECT-OPTIONS:LIFNR FOR LFA1-LIFNR.
    DATA:BEGIN OF ITAB OCCURS 0,
    LIFNR LIKE LFA1-LIFNR,
    NAME1 LIKE LFA1-NAME1,
    LAND1 LIKE LFA1-LAND1,
    ORT01 LIKE LFA1-ORT01,
    REGIO LIKE LFA1-REGIO,
    SORTL LIKE LFA1-SORTL,
    CFIELD(4) TYPE C,
    END OF ITAB.
    data:col(4).
    data:num value '1'.
    SELECT * FROM LFA1 INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE LIFNR
    IN LIFNR.
    LOOP AT ITAB.
    concatenate 'C' num '10' into col .
    ITAB-CFIELD = col.
    num = num + 1.
    if num = '8'.
    num = '1'.
    endif.
    MODIFY ITAB.
    ENDLOOP.
    TYPE-POOLS:SLIS.
    DATA:FCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA:LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA:SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE.
    DATA:EVE TYPE SLIS_T_EVENT WITH HEADER LINE.
    LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    LAYOUT-WINDOW_TITLEBAR = 'VENDORS DETAILS SCREEN'.
    LAYOUT-EDIT = 'X'.
    LAYOUT-info_fieldname = 'CFIELD'.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    I_PROGRAM_NAME = SY-REPID
    I_INTERNAL_TABNAME = 'ITAB'
    I_INCLNAME = SY-REPID
    CHANGING
    CT_FIELDCAT = FCAT.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FCAT
    TABLES
    T_OUTTAB = ITAB.
    this is for coloring cols
    REPORT ZBHCOLOR_COLS.
    TABLES:LFA1.
    SELECT-OPTIONS:C_LIFNR FOR LFA1-LIFNR. " FOR GRID ONLY
    PARAMETERS:LIST RADIOBUTTON GROUP ALV DEFAULT 'X',
    GRID RADIOBUTTON GROUP ALV.
    DATA:BEGIN OF ITAB OCCURS 0,
    LIFNR LIKE LFA1-LIFNR,
    NAME1 LIKE LFA1-NAME1,
    LAND1 LIKE LFA1-LAND1,
    ORT01 LIKE LFA1-ORT01,
    SORTL LIKE LFA1-SORTL,
    REGIO LIKE LFA1-REGIO,
    COL TYPE LVC_T_SCOL,
    END OF ITAB.
    DATA:COLR TYPE LVC_S_SCOL.
    SELECT * FROM LFA1 INTO CORRESPONDING FIELDS OF TABLE ITAB.
    LOOP AT ITAB.
    IF ITAB-LIFNR IN C_LIFNR.
    COLR-FNAME = 'NAME1'.
    COLR-COLOR-COL = '5'.
    COLR-COLOR-INT = '1'.
    COLR-COLOR-INV = '0'.
    COLR-NOKEYCOL = 'X'.
    APPEND COLR TO ITAB-COL.
    COLR-FNAME = 'LIFNR'.
    APPEND COLR TO ITAB-COL.
    MODIFY ITAB.
    ENDIF.
    ENDLOOP.
    TYPE-POOLS:SLIS.
    DATA:FCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA:LAYOUT TYPE SLIS_LAYOUT_ALV.
    LAYOUT-ZEBRA = 'X'.
    layout-coltab_fieldname = 'COL'.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    I_PROGRAM_NAME = SY-REPID
    I_INTERNAL_TABNAME = 'ITAB'
    I_INCLNAME = SY-REPID
    CHANGING
    CT_FIELDCAT = FCAT.
    IF LIST = 'X'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FCAT
    TABLES
    T_OUTTAB = ITAB.
    ELSEIF GRID = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FCAT
    TABLES
    T_OUTTAB = ITAB.
    ENDIF.
    Reward points if useful.

  • Coloring a field in the internal table

    Hi all,
    How can I color a field in the internal table knowing that I'm developing a classic report.
    Thanks in advance.

    hi,,,
    check this code.
    *-----TABLES DECLARATION
    tables : kna1,                     "Customer Master
           vbak,                     "Sales Document Header
             vbap,                     "Sales Document Item
             sscrfields.               "Screen Field Table
    &               D A T A   D E C L A R A T I O N                       &
    data : begin of it_kna1 occurs 0,
            kunnr type kna1-kunnr,      "Customer Number
            land1 type kna1-land1,      "Country Key
            name1 type kna1-name1,      "Name
            ort01 type kna1-ort01,      "City
           end of it_kna1.
    data : begin of it_kna2 occurs 0,
            kunnr type kna1-kunnr,      "Customer Number
            land1 type kna1-land1,      "Country Key
            name1 type kna1-name1,      "Name
            ort01 type kna1-ort01,      "City
           end of it_kna2.
    data:  begin of it_vbak occurs 0,
            vbeln type vbak-vbeln,      "Sales Document
            erdat type vbak-erdat,      "Date
            ernam type vbak-ernam,      "Name of Person
            auart type vbak-auart,      "Sales Document Type
           end of it_vbak.
    data:  begin of it_vbap occurs 0,
            vbeln type vbap-vbeln,      "Sales Document
            posnr type vbap-posnr,      "Sales Document Item
            matnr type vbap-matnr,      "Material Number
            matkl type vbap-matkl,      "Material group
           end of it_vbap.
    data: v_count type int4,           "Current Row Index
           v_line like sy-lisel,        "Contents of selected line
           v_kunnr like kna1-kunnr.
    &                S E L E C T I O N  S C R E E N                       &
    selection-screen begin of block b1 with frame title text-001.
    selection-screen begin of line.
    parameters : rb1 radiobutton group g1 default 'X'.
    selection-screen comment 5(20) text-002 for field rb1.
    selection-screen end of line.
    select-options : so_kunnr for kna1-kunnr obligatory.
    parameters : p_hits(3) type c.
    selection-screen begin of line.
    parameters : rb2 radiobutton group g1.
    selection-screen comment 5(20) text-003 for field rb2.
    selection-screen end of line.
    parameters : p_file like rlgrap-filename default 'c:\test'.
    selection-screen pushbutton /33(10) custl user-command push1.
    selection-screen pushbutton 58(10) custd user-command push2.
    selection-screen end of block b1.
    &                  I N I T I A L I Z A T I O N                        &
    initialization.
      move 'LOAD' to custl.
      move 'DISP' to custd.
    &                  A T  L I N E  S E L E C T I O N                    &
    at selection-screen.
      perform validate_kunnr.
    &  A T  S E L E C T I O N  S C R E E N  O N  V A L U E-R E Q U E S T  &
    at selection-screen on value-request for p_file.
      call function 'F4_FILENAME'
        exporting
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = ' '
        importing
          file_name     = p_file.
    &              S T A R T  O F  S E L E C T I O N                      &
    start-of-selection.
      perform cust_details.
    &              S T A R T  O F  S E L E C T I O N                      &
    top-of-page.
      format color 3 intensified off.
      write :/02(25) sy-repid.
      write : 39(15) 'Page'(010), sy-pagno.
      format color off.
      format color 6 intensified off.
      format color col_heading.
      uline at :/1(60).
      write: /1 sy-vline,
              2 'Cust Number'(000),
              14 sy-vline,
              16 'Country'(007),
              25 sy-vline,
              26 'City'(008),
              42 sy-vline,
              43 'Region'(009),
              60 sy-vline.
      uline at :/1(60).
      format color col_heading off.
    &   T O P  O F  P A G E  D U R I N G  L I N E  S E L E C T I O N      &
    top-of-page during line-selection.
      if sy-lsind eq 1 or sy-ucomm eq 'VBAK'.
        format color col_heading.
        uline at :/1(60).
        write : /1 sy-vline,
                     2 'Docu No.'(011),
                     14 sy-vline,
                     16 'Date'(012),
                     26 sy-vline,
                     27 'Name'(013),
                     42 sy-vline,
                     43 'DType'(014),
                     60 sy-vline.
        uline at :/1(60).
      elseif sy-lsind eq 2 or sy-ucomm eq 'VBAK'.
        set pf-status space.
        uline at :/1(60).
        write : /1 sy-vline,
                     2 'Docu No.'(015),
                     14 sy-vline,
                     16 'Sales Item'(016),
                     25 sy-vline,
                     26 'Mat No'(017),
                     42 sy-vline,
                     43 vbap-matkl,
                     50 'Mat Grp'(018),
                     60 sy-vline.
        uline at :/1(60).
      endif.
    &  AT USER-COMMAND                                                    &
    at user-command.
      case sy-ucomm.
        when 'VBAK'.
          perform sales_item.
        when 'DELIVERY'.
          clear it_vbak-vbeln.
          get cursor value it_vbak-vbeln.
          set parameter id 'AUN' field it_vbak-vbeln.
          call transaction 'VA03' and skip first screen.
        when 'DISP'.
          perform display_basic.
      endcase.
    &      AT LINE SELECTION                                              &
    at line-selection.
      if sy-lsind = 1.
        set pf-status 'DDDD'.
        perform sales_header.
      elseif  sy-lsind = 2.
      case sy-ucomm.
        when 'PICK'.
        set pf-status space.
        perform sales_item.
        when 'DELIVERY'.
          clear it_vbak-vbeln.
          get cursor value it_vbak-vbeln.
          set parameter id 'AUN' field it_vbak-vbeln.
          call transaction 'VA03' and skip first screen.
        when 'DISP'.
          perform display_basic.
      endcase.
       PERFORM sales_item.
      endif.
    &  AT USER-COMMAND                                                    &
    at user-command.
      case sy-ucomm.
        when 'VBAK'.
          perform sales_item.
        when 'DELIVERY'.
          clear it_vbak-vbeln.
          get cursor value it_vbak-vbeln.
          set parameter id 'AUN' field it_vbak-vbeln.
          call transaction 'VA03' and skip first screen.
        when 'DISP'.
          perform display_basic.
      endcase.
    &      Form  CUST_DETAILS                                             &
    form cust_details .
      select kunnr
             land1
             name1
             ort01
             from kna1
             into table it_kna1
             where kunnr in so_kunnr.
      if sy-subrc <> 0.
        message 'SELECT VALID CUST NO' type 'I'.
      else.
        loop at it_kna1.
         v_count = v_count + 1.
          if sy-tabix < p_hits.
         IF v_count <= p_hits.
            move it_kna1 to it_kna2.
            append it_kna2.
          else.
            exit.
          endif.
        endloop.
      endif.
      if not it_kna2[] is initial.
        loop at it_kna2.
          write : /1 sy-vline,
                   2 it_kna2-kunnr,
                   14 sy-vline,
                   16 it_kna2-land1,
                   25 sy-vline,
                   26 it_kna2-name1,
                   42 sy-vline,
                   43 it_kna2-ort01,
                   60 sy-vline.
          uline at :/1(60).
        endloop.
      endif.
    endform.                    " CUST_DETAILS
    **&      Form  load_file
    *form load_file .
    *endform.                    " load_file
    **&      Form  disp_file
    *form disp_file .
    *endform.                    " disp_file
    *&      Form  VALIDATE_KUNNR
    form validate_kunnr .
      select single kunnr
                    from kna1
                    into kna1
                    where kunnr = so_kunnr.
    endform.                    " VALIDATE_KUNNR
    *&      Form  SALES_HEADER
    form sales_header .
    data : v_kna1(13).
    v_kna1 = 'IT_KNA2-KUNNR'.
    *get cursor line sy-lilli value v_line
    clear v_kunnr.
      get cursor  field v_kna1 value v_kunnr.
    v_kunnr = v_line+1(10).
      call function 'CONVERSION_EXIT_ALPHA_INPUT'
        exporting
          input  = v_kunnr
        importing
          output = v_kunnr.
      select vbeln
             erdat
             ernam
             auart
             from vbak
             into table it_vbak
             where  kunnr = v_kunnr.
      if sy-subrc = 0.
        loop at it_vbak.
          write : /1 sy-vline,
                   2 it_vbak-vbeln,
                   14 sy-vline,
                   16 it_vbak-erdat,
                   26 sy-vline,
                   27 it_vbak-ernam,
                   42 sy-vline,
                   43 it_vbak-auart,
                   60 sy-vline.
          uline at :/1(60).
        endloop.
      endif.
    endform.                    " SALES_HEADER
    *&      Form  SALES_ITEM
    form sales_item .
    data : v_vbeln(13).
    v_vbeln = 'IT_VBAK-VBELN'.
    clear it_vbak-vbeln.
    get cursor  field v_vbeln value it_vbak-vbeln.
      call function 'CONVERSION_EXIT_ALPHA_INPUT'
        exporting
          input  = it_vbak-vbeln
        importing
          output = it_vbak-vbeln.
      select vbeln
             posnr
             matnr
             matkl
      from vbap
      into table it_vbap
      where vbeln = it_vbak-vbeln.
      loop at it_vbap .
        write : /1 sy-vline,
                   2 it_vbap-vbeln,
                   14 sy-vline,
                   16 it_vbap-posnr,
                   25 sy-vline,
                   26 it_vbap-matnr,
                   42 sy-vline,
                   43 it_vbap-matkl,
                   60 sy-vline.
        uline at :/1(60).
      endloop.
    endform.                    " SALES_ITEM
    *&      Form  DISP_DOCU
    form display_basic .
      loop at it_kna1 into it_kna1.
        format hotspot on.
        write : /03 it_kna1-kunnr,
                 24  it_kna1-name1.
        hide it_kna1-kunnr.
      endloop.
    endform.                    " display_basic
    pls reward if useful
    regards,
    rekha

  • Change Color of SELECTION-SCREEN COMMENT

    Hello!
    I want to change the color of the text of my comments for parameters in my selection-screen. Is that possible?
    What kind of design option do I have within the selection-screen? (Background, Colors, etc...)
    Regards Michael

    check out this sample code.
    REPORT YRJKSJKJFKD
           NO STANDARD PAGE HEADING.
    SELECTION-SCREEN COMMENT /1(50) comm1 MODIF ID mg1.
    SELECTION-SCREEN ULINE.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN COMMENT /1(30) comm2.
    SELECTION-SCREEN ULINE /1(50).
    PARAMETERS: r1 RADIOBUTTON GROUP rad1,
                r2 RADIOBUTTON GROUP rad1,
                r3 RADIOBUTTON GROUP rad1.
    SELECTION-SCREEN ULINE /1(50).
    AT SELECTION-SCREEN OUTPUT.
      comm1 ='Selection Screen'.
      comm2 ='Select one'.
      LOOP AT SCREEN.
        IF screen-group1 = 'MG1'.
           screen-intensified = '0'.
           screen-color = '0' .
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    for screen-color the possible values are
    Syntax of color value in col color
    { COL_BACKGROUND } 0 GUI-specific
    { 1 | COL_HEADING } 1 Gray-blue
    { 2 | COL_NORMAL } 2 Light gray
    { 3 | COL_TOTAL } 3 Yellow
    { 4 | COL_KEY } 4 Blue-green
    { 5 | COL_POSITIVE } 5 Green
    { 6 | COL_NEGATIVE } 6 Red
    { 7 | COL_GROUP } 7 Violet
    Regards
    Raja

  • Make RadioButton appear as ToggleButton

    Hello,
    I have spent much time in this issue, but couldn't find a proper solution.
    I have a panel with togglebuttons on it. These togglebuttons are listitems of different Lists and can't be grouped under one parent.
    What I need now is that all the togglebuttons are pressed exclusively, just same behavior like radiobuttons. But as grouping the togglebuttons under the same parent is not an option, it doesn't work.
    The only way i can think of now is to use radiobuttons instead of togglebuttons and all radiobuttons have the same groupname. But the problem is now to change the radiobuttons control template to make them appear as togglebuttons.
    Do you know whether there is an example of a template which makes a radiobutton appear as a togglebutton?
    Or maybe you have another solution?
    Thank you very much

    This also makes a perfect use for extending a style using BasedOn attribute:
    Code Snippet
    // Create a RadioButton style baed on the ToggleButton style
    <Style x:Key="toggleStyle" BasedOn="{StaticResource {x:Type ToggleButton}}"
                                TargetType="{x:Type RadioButton}">
     <Style.Triggers>
       <Trigger Property="IsChecked" Value="true">
          <Setter Property="Background" Value="Red"/>
       </Trigger>
     </Style.Triggers>
    </Style>
    Now you can create radio buttons that look just like toggle buttons. And according to the style above, their background color will change to Red when checked:
    Code Snippet
    <RadioButton Content="My Radion Button" Click="Toggle_Handler" Width="300"
                        Style="{StaticResource toggleStyle}"></RadioButton>

  • Removing unwanted white edges from a checkbox (radiobutton)

    Is there a way to remove the white edges of a radiobutton ( by making the edges transparant or something like that?)
    see:
    http://www.spymac.com/gallery/data/500/11225unwantededges.GIF
    thanks in advance.

    try to set the background color of the checkbox to the background color of the panel or frame you are using.
    checkbox1.setBackground(getBackground()); // assuming you are calling this function in the parent panel or frame.
    Hope that works.
    JP

  • Problem in displaying data using Radiobuttons?

    Hi All,
    I have a requirement where along with some input fields in have three radiobuttons and under each of the radiobuttons there are date fields, now when i click on the first radiobutton the second date field has to be disabled and the a report o/p has to be generated, again when i click on the second radibutton the first date field has to be disbaled and second report o/p has to be generated and when the third one is clicked both the date fields has to be disabled and the third report o/p has to be generated.
    I have written the code for disabling the fields, the problem is when i click on the second radiobutton it does not disable the first date field and is taking a long time in execution and the control is terminating the program.
    The report o/p logic has been written in three different subroutine forms. Please tell me how i can overcome this problem. I am attaching my code in this mail.
    selection-screen begin of block b1 with frame title text-001.
    select-options: s_bukrs for v1 modif id ABC,
                    s_vkorg for v2 obligatory modif id ABC,
                    s_vtweg for v3 obligatory modif id ABC,
                    s_spart for v4 obligatory modif id ABC,
                    s_fkart for v5 obligatory modif id ABC.
    selection-screen end of block b1.
    selection-screen begin of block b2 with frame title text-002.
    selection-screen begin of line.
    parameters: p1 radiobutton group g1 default 'X' user-command ucomm.
    selection-screen end of line.
    parameters:s_date type sy-datum modif id XYZ.
    selection-screen skip 1.
    selection-screen begin of line.
    parameters:p2 radiobutton  group g1.
    selection-screen end of line.
    parameters:s_date1 type sy-datum modif id XYZ.
    selection-screen skip 1.
    selection-screen begin of line.
    parameters:p3 radiobutton group g1.
    selection-screen end of line.
    selection-screen skip 1.
    selection-screen end of block b2.
    At Selection-Screen Output.
    loop at screen.
    if p1 = 'X' and
    screen-name = 'S_DATE1' or screen-group1 = 'ABC' .
    screen-input = 0.
    modify screen.
    elseif p2 = 'X'
    and screen-name = 'S_DATE' or screen-group1 = 'ABC'.
    screen-input = 0.
    modify screen.
    elseif p3 = 'X' or screen-group1 = 'ABC'.
    check screen-group1 = 'XYZ'.
    screen-active = 0.
    modify screen.
    endif.
    endloop.
    At Selection-Screen.
    if p1 = 'X'.
    perform dailysummaryinvoice.
    elseif p2 = 'X'.
    perform blockedinvoices.
    elseif p3 = 'X'.
    write:/ 'Display'.
    endif.
    refresh: s_bukrs,
           s_vkorg,
           s_vtweg,
           s_spart,
           s_fkart.
    Please help.
    Regards,
    MD

    Hi friend,
    Check this code i hope it ll be hep full for u.
    *& Report  ZDTK_FI_CRDB
    *& AUTHOR            : D TARUN KUMAR
    *& FUNC CONSULTANT   : ABDUL GANI
    *& TRANSPORT REQ NO. : RD1K902089
    *& PACKAGE           : ZTARUN
    *& TRANSACTION CODE  : ZCRDB
    *& DESCRIPTION : CREDIT DEBIT NOTE FOR CUSTOMER OR VENDOR.
    REPORT  ZDTK_FI_CRDB NO STANDARD PAGE HEADING
                                LINE-COUNT 65(5)
                                LINE-SIZE 80
                                MESSAGE-ID ZTAR_FI
    *&       STRUCTURE DECLARATION
    TYPES : BEGIN OF TY_ADDR,
                    BUKRS TYPE BUKRS,          "COMPANY CODE
                    LIFNR TYPE LIFNR,          "VENDOR NO
                    KUNNR TYPE KUNNR,          "CUSTOMJER NO
                    NAME1 TYPE NAME1,          "NAME1
                    NAME2 TYPE NAME2,          "NAME2
                    ORT01 TYPE ORT01,          "CITY
                    ORT02 TYPE ORT02,
                    PSTLZ TYPE PSTLZ,          "POSTAL CODE
                    STRAS TYPE STRAS,          "STREET
                    ADRNR TYPE ADRNR,          "ADDRESS NO
                    TELF1 TYPE TELF1,          "TELEFHONE NO
                    TELF2 TYPE TELF2,          "TELEFHONE NO 2
                    TELFX TYPE TELFX,          "FAX
             END OF TY_ADDR,
          BEGIN OF TY_LFA1,
                   KUNNR TYPE KUNNR,          "CUSTOMJER NO
                   NAME1 TYPE NAME1,          "NAME1
                   NAME2 TYPE NAME2,          "NAME2
                   ORT01 TYPE ORT01,          "CITY
                   ORT02 TYPE ORT02,
                   PSTLZ TYPE PSTLZ,          "POSTAL CODE
                   STRAS TYPE STRAS,          "STREET
                   ADRNR TYPE ADRNR,          "ADDRESS NO
                   TELF1 TYPE TELF1,          "TELEFHONE NO
                   TELF2 TYPE TELF2,          "TELEFHONE NO 2
                   TELFX TYPE TELFX,          "FAX
            END OF TY_LFA1,
           BEGIN OF TY_DOCM,
                    GJAHR TYPE GJAHR,
                    BELNR TYPE BELNR_D,
                    BUDAT TYPE BUDAT,
                    BLDAT TYPE BLDAT,
                    BLART TYPE BLART,
                    BSCHL TYPE BSCHL,
                    SHKZG TYPE SHKZG,
                    XBLNR TYPE XBLNR,
                    DMBTR TYPE DMBTR,
                    SGTXT TYPE SGTXT,
                    REBZG TYPE REBZG,
                    REBZJ TYPE REBZJ,
                    KUNNR TYPE KUNNR,
                    LIFNR TYPE LIFNR,
             END OF TY_DOCM.
    *&       TABLE DECLARATION
    DATA : T_ADDR TYPE STANDARD TABLE OF TY_ADDR,
    *&       WORK AREA  DECLARATION
           W_ADDR TYPE TY_ADDR,
           W_DOCM TYPE TY_DOCM,
          W_LFA1 TYPE TY_LFA1,
    *&       GLOBLE VARIABLE DECLARATION
           G_KUNNR TYPE KUNNR,
           G_LIFNR TYPE LIFNR,
           DCAMT TYPE DMBTR.
    *&       INITIALIZATION
    INITIALIZATION.
    CLEAR :
    *REFRESH :
    *&       SELECTION SCREEN DECLARATION
    SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECTION-SCREEN SKIP 1.
    PARAMETERS : S_BUKRS TYPE BSID-BUKRS OBLIGATORY DEFAULT '1000'.
    PARAMETERS : S_BELNR TYPE BELNR_D OBLIGATORY DEFAULT '1600000070'.
    PARAMETERS : S_GJAHR TYPE GJAHR OBLIGATORY DEFAULT '2008'.
    PARAMETERS : ASON TYPE BUDAT OBLIGATORY DEFAULT SY-DATUM.
    PARAMETERS : S_KUNNR TYPE KUNNR MODIF ID GP1.
    PARAMETERS : S_LIFNR TYPE LIFNR MODIF ID GP2.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN : END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS R1  RADIOBUTTON GROUP RAO DEFAULT 'X' USER-COMMAND hit.
    SELECTION-SCREEN COMMENT (50) TEXT-003 FOR FIELD R1.
    PARAMETERS R2  RADIOBUTTON GROUP RAO.
    SELECTION-SCREEN COMMENT (50) TEXT-004 FOR FIELD R2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN END OF BLOCK B2.
    *SELECTION-SCREEN: BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-005.
    *SELECTION-SCREEN SKIP 1.
    *SELECTION-SCREEN BEGIN OF LINE.
    *PARAMETERS R3  RADIOBUTTON GROUP RAJ DEFAULT 'X' USER-COMMAND hit.
    *SELECTION-SCREEN COMMENT (50) TEXT-006 FOR FIELD R1.
    *PARAMETERS R4  RADIOBUTTON GROUP RAJ.
    *SELECTION-SCREEN COMMENT (50) TEXT-007 FOR FIELD R2.
    *SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN SKIP 1.
    *SELECTION-SCREEN : END OF BLOCK B3.
    *&       AT SELECTION SCREEN
    AT SELECTION-SCREEN.
           PERFORM VALIDATE_SELECTION.
    *&       AT SELECTION SCREEN OUTPUT
    AT SELECTION-SCREEN OUTPUT.
           PERFORM SCREEN_OUTPUT.
    *&       START OF SELECTION
    START-OF-SELECTION.
    IF R1 = 'X'.
            PERFORM GET_DOCUMENT_L.
    ELSEIF R2 = 'X'.
            PERFORM GET_DOCUMENT_K.
    ENDIF.
    *&       END OF SELECTION
    END-OF-SELECTION.
    PERFORM DISPLAY.
    *&       TOP OF PAGE
    *TOP-OF-PAGE.
          PERFORM PAGE_HEADER.
    *&      Form  VALIDATE_SELECTION
          text
    form VALIDATE_SELECTION .
    DATA : L_BUKRS TYPE BSID-BUKRS.
    SELECT SINGLE BUKRS FROM KNB1
                        INTO L_BUKRS
                       WHERE BUKRS = S_BUKRS.
    *IF SY-SUBRC <> 0.
    *MESSAGE E001.
    *LEAVE LIST-PROCESSING.
    *ENDIF.
    DATA : L_KUNNR TYPE BSID-KUNNR.
    SELECT SINGLE KUNNR FROM BSID
                        INTO L_KUNNR
                       WHERE KUNNR = S_KUNNR.
    *IF SY-SUBRC <> 0.
    *MESSAGE E002.
    *LEAVE LIST-PROCESSING.
    *ENDIF.
    endform.                    " VALIDATE_SELECTION
    *&      Form  SCREEN_OUTPUT
          text
    form SCREEN_OUTPUT .
        IF R1 = 'X'.
          LOOP AT SCREEN.
            if screen-group1 = 'GP1'.
              SCREEN-active = '0'.
    *SCREEN-INTENSIFIED = '0'.
              MODIFY SCREEN.
            ENDIF.
          ENDLOOP.
        ELSE.
          LOOP AT SCREEN.
            IF SCREEN-group1 = 'GP2'.
              SCREEN-active = '0'.
    *SCREEN-INTENSIFIED = '1'.
              MODIFY SCREEN.
            ENDIF.
          ENDLOOP.
        ENDIF.
    endform.                    " SCREEN_OUTPUT
    *&      Form  GET_DOCUMENT_L
          text
    FORM GET_DOCUMENT_L .
    DATA : MESSG(60).
    SELECT SINGLE BUKRS
                  LIFNR
                  GJAHR
                  BELNR
                  BUDAT
                  BLDAT
                  BLART
                  BSCHL
                  SHKZG
                  DMBTR
                  SGTXT
                  REBZG
                  REBZJ FROM BSIK
                        INTO CORRESPONDING FIELDS OF W_DOCM
                       WHERE BUKRS = S_BUKRS AND
                             GJAHR = S_GJAHR AND
                             BELNR = S_BELNR.
    SELECT SINGLE DMBTR FROM BSIK INTO DCAMT
                       WHERE BELNR = W_DOCM-REBZG AND
                             GJAHR = W_DOCM-REBZJ.
    IF NOT W_DOCM IS INITIAL.
            PERFORM GET_LFA1.
    ELSE.
    SELECT SINGLE BUKRS
                  LIFNR
                  GJAHR
                  BELNR
                  BUDAT
                  BLDAT
                  BLART
                  BSCHL
                  SHKZG
                  DMBTR
                  SGTXT
                  REBZG
                  REBZJ FROM BSAK
                        INTO CORRESPONDING FIELDS OF W_DOCM
                       WHERE BUKRS = S_BUKRS AND
                             GJAHR = S_GJAHR AND
                             BELNR = S_BELNR.
    SELECT SINGLE DMBTR FROM BSAK INTO DCAMT
                       WHERE BELNR = W_DOCM-REBZG AND
                             GJAHR = W_DOCM-REBZJ.
          IF NOT W_DOCM IS INITIAL.
                  PERFORM GET_LFA1.
          ELSE.
          CONCATENATE 'THERE IS NO DOCUMENT NO' S_BELNR S_GJAHR 'FOR VENDOR' INTO  MESSG
                       SEPARATED BY SPACE.
          MESSAGE I011 WITH MESSG.
          LEAVE LIST-PROCESSING.
          ENDIF.
    ENDIF.
    ENDFORM.                    " GET_DOCUMENT_L
    *&      Form  GET_LFA1
          text
    FORM GET_LFA1 .
    SELECT SINGLE LIFNR
                  NAME1
                  NAME2
                  ORT01
                  ORT02
                  PSTLZ
                  STRAS
                  ADRNR
                  TELF1
                  TELF2
                  TELFX FROM LFA1 INTO CORRESPONDING FIELDS OF W_ADDR
                          WHERE LIFNR = W_DOCM-LIFNR.
    ENDFORM.                    " GET_LFA1
    *&      Form  GET_DOCUMENT_K
          text
    FORM GET_DOCUMENT_K .
    DATA : MESSG(60).
    SELECT SINGLE BUKRS
                  KUNNR
                 LIFNR
                  GJAHR
                  BELNR
                  BUDAT
                  BLDAT
                  BLART
                  BSCHL
                  SHKZG
                  DMBTR
                  SGTXT
                  REBZG
                  REBZJ FROM BSID
                        INTO CORRESPONDING FIELDS OF W_DOCM
                       WHERE  BUKRS = S_BUKRS AND
                              GJAHR = S_GJAHR AND
                              BELNR = S_BELNR.
    SELECT SINGLE DMBTR FROM BSID INTO DCAMT
                       WHERE BELNR = W_DOCM-REBZG AND
                             GJAHR = W_DOCM-REBZJ.
    IF NOT W_DOCM IS INITIAL.
            PERFORM GET_KNA1.
    ELSE.
    SELECT SINGLE BUKRS
                  KUNNR
                 LIFNR
                  GJAHR
                  BELNR
                  BUDAT
                  BLDAT
                  BLART
                  BSCHL
                  SHKZG
                  DMBTR
                  SGTXT
                  REBZG
                  REBZJ FROM BSAD
                        INTO CORRESPONDING FIELDS OF W_DOCM
                       WHERE  BUKRS = S_BUKRS AND
                              GJAHR = S_GJAHR AND
                              BELNR = S_BELNR.
    SELECT SINGLE DMBTR FROM BSAD INTO DCAMT
                       WHERE BELNR = W_DOCM-REBZG AND
                             GJAHR = W_DOCM-REBZJ.
          IF NOT W_DOCM IS INITIAL.
                  PERFORM GET_KNA1.
          ELSE.
          CONCATENATE 'THERE IS NO DOCUMENT NO' S_BELNR S_GJAHR 'FOR CUSTOMER' INTO  MESSG
                       SEPARATED BY SPACE.
          MESSAGE I011 WITH MESSG.
          LEAVE LIST-PROCESSING.
          ENDIF.
    ENDIF.
    ENDFORM.                    " GET_DOCUMENT_K
    *&      Form  GET_KNA1
          text
    FORM GET_KNA1 .
    SELECT SINGLE KUNNR
                  NAME1
                  NAME2
                  ORT01
                  ORT02
                  PSTLZ
                  STRAS
                  ADRNR
                  TELF1
                  TELF2
                  TELFX FROM KNA1 INTO CORRESPONDING FIELDS OF W_ADDR
                          WHERE KUNNR = W_DOCM-KUNNR.
    ENDFORM.                    " GET_KNA1
    *&      Form  DISPLAY
          text
    FORM DISPLAY .
    LONG TEXT *************************
    *DATA : BEGIN OF inline OCCURS 0,
    *END OF inline.
    *TYPES: BEGIN OF TY_LONGT,
                   tdformat TYPE tdformat,
                   tdline TYPE tdline,
          END OF TY_LONGT.
    *DATA : TLONGT TYPE STANDARD TABLE OF TY_LONGT,
          WLONGT TYPE TY_LONGT.
    DATA: BEGIN OF DTEXT OCCURS 50.
    *DATA: MATNR LIKE PBIM-MATNR.
    INCLUDE STRUCTURE TLINE.
    DATA: END OF DTEXT.
    DATA: BEGIN OF HTEXT.
    INCLUDE STRUCTURE THEAD.
    DATA: END OF HTEXT.
    DATA: BEGIN OF LTEXT OCCURS 50.
    INCLUDE STRUCTURE TLINE.
    DATA: END OF LTEXT.
    DATA: TNAME LIKE THEAD-TDNAME.
    CONCATENATE S_BUKRS W_DOCM-BELNR S_GJAHR '002' INTO  TNAME.
    *SEPARATED BY SPACE.
    DATA : W_STXL TYPE STXL.
    SELECT SINGLE * FROM STXL INTO W_STXL
                             WHERE TDNAME = TNAME.
    IF NOT W_STXL IS INITIAL.
    *SELECT * FROM PBIM WHERE WERKS IN S_WERKS.
    *MOVE PBIM-BDZEI TO TNAME.
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
        CLIENT                        = SY-MANDT
        ID                            = W_STXL-TDID
        LANGUAGE                      = W_STXL-TDSPRAS
        NAME                          = TNAME
        OBJECT                        = W_STXL-TDOBJECT
      ARCHIVE_HANDLE                = 0
      LOCAL_CAT                     = ' '
    IMPORTING
        HEADER                        = HTEXT
      TABLES
        LINES                         = LTEXT
    EXCEPTIONS
      ID                            = 1
      LANGUAGE                      = 2
      NAME                          = 3
      NOT_FOUND                     = 4
      OBJECT                        = 5
      REFERENCE_CHECK               = 6
      WRONG_ACCESS_TO_ARCHIVE       = 7
      OTHERS                        = 8
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT LTEXT.
    IF LTEXT-TDLINE NE ''.
    MOVE LTEXT-TDLINE TO DTEXT-TDLINE.
    APPEND DTEXT.
    ENDIF.
    ENDLOOP.
    ENDIF.
    LONG TEXT *************************
    CUSTOMER / VENDOR NO *************************
    DATA : CUVE(10).
    IF R1 = 'X'.
    CUVE = W_ADDR-LIFNR.
    ELSEIF R2 = 'X'.
    CUVE = W_ADDR-KUNNR.
    ENDIF.
    CUSTOMER / VENDOR NO *************************
    CR / DR DATA *************************
    IF DCAMT IS INITIAL.
    SELECT SINGLE DMBTR FROM BSIS INTO DCAMT
                       WHERE BELNR = W_DOCM-REBZG AND
                             GJAHR = W_DOCM-REBZJ .
                          ( KOART = 'D' OR KOART = 'K' ).
    ENDIF.
    CR / DR DATA *************************
    DATA: CNAME TYPE BUTXT.
    SELECT SINGLE BUTXT FROM T001 INTO CNAME
                       WHERE BUKRS = S_BUKRS.
    DATA : NAME(60),
           STREET(60),
           TELFX(60).
    CONCATENATE W_ADDR-NAME1 W_ADDR-NAME2 INTO  NAME
    SEPARATED BY SPACE.
    CONCATENATE W_ADDR-ORT01 W_ADDR-ORT02 'POSTAL CODE :' W_ADDR-PSTLZ INTO  STREET
    SEPARATED BY SPACE.
    CONCATENATE 'Tel No.:' W_ADDR-TELF1 W_ADDR-TELF2 'FAX :' W_ADDR-TELFX INTO  TELFX
    SEPARATED BY SPACE.
    DATA : CRDB(20),
           CRDBA(16),
           BALC TYPE DMBTR.
    IF W_DOCM-SHKZG = 'S'.
    CRDB = 'Debit Note No. :'.
    CRDBA = 'DEBIT'.
    BALC = DCAMT + W_DOCM-DMBTR.
    ELSEIF W_DOCM-SHKZG = 'H'.
    CRDB = 'Credit Note No. :'.
    CRDBA = 'CREDIT'.
    BALC = DCAMT - W_DOCM-DMBTR.
    ENDIF.
    SKIP 5.
    *FORMAT INVERSE.
                ULINE 03(77).
    WRITE : 03 SY-VLINE, 80 '|',
            /03 SY-VLINE, NAME, 60 'No.:' COLOR 7, CUVE COLOR 7, 80 '|',
            /03 SY-VLINE, W_ADDR-STRAS, 80 '|',
            /03 SY-VLINE, STREET, 80 '|',
            /03 SY-VLINE, TELFX, 80 '|',
            /03 SY-VLINE, 80 '|',
            /03 SY-VLINE, 80 '|',
            /03 SY-VLINE, 80 '|',
            /03 SY-VLINE, 05 CNAME COLOR 2,  80 '|',
            /03 SY-VLINE, 36 CRDB RIGHT-JUSTIFIED, 59 W_DOCM-BELNR, 71 W_DOCM-GJAHR, 80 '|',
            /03 SY-VLINE, 58 'DATE :', W_DOCM-BUDAT, 80 '|',
            /03 SY-VLINE, 80 '|'. ULINE 03(77).
    WRITE : /03 SY-VLINE, 80 '|'.
    IF NOT DTEXT IS INITIAL.
    LOOP AT DTEXT.
    WRITE : /03 SY-VLINE, 05 DTEXT-TDLINE COLOR 1, 80 '|'.
    ENDLOOP.
    ELSEIF W_DOCM-SGTXT NE ''.
    WRITE : /03 SY-VLINE, 05 W_DOCM-SGTXT COLOR 1, 80 '|'.
    ELSE.
    WRITE : /03 SY-VLINE, 80 '|'.
    ENDIF.
    WRITE : /03 SY-VLINE, 80 '|',
    *WRITE : /03 SY-VLINE, TNAME, 80 '|',
           /03 SY-VLINE, 80 '|',
            /03 SY-VLINE, 80 '|',
            /03 SY-VLINE, 80 '|',
            /03 SY-VLINE, 08 'WORKING OF INTEREST CALCULATION AS ON                                   ' COLOR 4,
             47 ASON COLOR 4, '  [ 360 DAYS BASIS ]' COLOR 4, 80 '|',
            /03 SY-VLINE, 80 '|'. ULINE 03(77).
    WRITE : /03 SY-VLINE, 11 'DATE', 23 'INVOICE', 41 CRDBA, 55 'BALANCE', 64 'DAYS', 70 'INTEREST', 80 '|',
            /03 SY-VLINE, 23 ' AMOUNT', 41 'AMOUNT', 55' AMOUNT', 70 ' @ 8.00% ', 80 '|',
            /03 SY-VLINE, 80 '|'. ULINE 03(77).
    WRITE : /03 SY-VLINE, 80 '|',
            /03 SY-VLINE, 06 W_DOCM-BUDAT, 15 DCAMT, 32 W_DOCM-DMBTR, 47 BALC, 80 '|',
            /03 SY-VLINE, 80 '|',
            /03 SY-VLINE, 80 '|',
            /03 SY-VLINE, 80 '|',
            /03 SY-VLINE, 80 '|',
            /03 SY-VLINE, 80 '|',
            /03 SY-VLINE, 80 '|',
            /03 SY-VLINE, 80 '|',
            /03 SY-VLINE, 80 '|',
            /03 SY-VLINE, 80 '|',
            /03 SY-VLINE, 80 '|'. ULINE 03(77).
    WRITE : /03 SY-VLINE, 80 '|',
            /03 SY-VLINE, 80 '|',
            /03 SY-VLINE, 80 '|',
            /03 SY-VLINE, 10 'PREPARED BY', 35 'ACCOUNTANT', 60 'MANAGER', 80 '|',
            /03 SY-VLINE, 80 '|',
            /03 SY-VLINE, 80 '|'. ULINE 03(77).
    ENDFORM.                    " DISPLAY
    Thanks & Regards,
    D Tarun Kumar.
    Edited by: Devalla Tarun Kr. on Aug 28, 2008 3:40 PM

  • How do i set the background of radioButton Transparentha

    i have set an image on the panel and as i have added a radiobutton on it it background is white
    and even though i m using this code to paste animage on the panel
    private BufferedImage image;
         public Front2( )
              try
                   image = ImageIO.read(new File("s1.jpg" ));
              catch (IOException ex)
                        System.out,println("no image found");
    and following code for the radio button
    public void go1()
         frame = new JFrame("Simple Quiz Game");
                        JPanel mainPanel = new Front2(1);     
         a = new JRadioButton("Easy",true);
                             //a.setForeground(Color.white);
                             a.setBounds(50,100,220,35);
                             b = new JRadioButton("Medium");
                             //b.setForeground(Color.white);
                             b.setBounds(50,150,220,35);
    mainPanel.setLayout(null);
                             mainPanel.add(a);
                             mainPanel.add(b);
    frame.getContentPane().add( mainPanel);
                             frame.setSize(250,350);
                             frame.setVisible(true);
                             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    please help me out
    when i run the program the radio button appears on the image
    with white color
    can't i set the color to transparent so that the image will became background to the
    raadio button

    Note: This thread was originally posted in the [New To Java|http://forums.sun.com/forum.jspa?forumID=54] forum, but moved to this forum for closer topic alignment.

  • Changing color of components

    Hi
    I am new to java swing. I have created a gui for one my applications using swing. The layout of the gui is proper but i want to change the color of the buttons to blue from gray. I have used radio buttons,sliders and buttons which are to be changed. I was able to change the color of the content of buttons using html but how should change the color of the buttons.
    Please help.
    Thankx in advance.
    Sushant

    Here's a modified version of what you posted. I should check the tutorial links of Swing that I posted earlier.
    Also try reading about arrays.
    import java.awt.Color;
    import java.awt.Container;
    import javax.swing.BoxLayout;
    import javax.swing.ButtonGroup;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JRadioButton;
    import javax.swing.JSlider;
    import javax.swing.border.TitledBorder;
    public class WordigoGUI {
         JPanel pane = new JPanel();
         JPanel paneslider = new JPanel();
         JLabel labels;
         public WordigoGUI() {
              JFrame f = new JFrame("WordigoGUI");
              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);     
              createGUI(f);
              f.pack();
              f.setVisible(true);
         void createGUI(JFrame f)
              JSlider slider = new JSlider(JSlider.HORIZONTAL,5,10,7);
              final int boardChoice = 6;
              JRadioButton[] radioButtons = new JRadioButton[boardChoice];
              TitledBorder titled = new TitledBorder("Choose your board");
              final ButtonGroup group = new ButtonGroup();
              for(int i=0;i<6;i++)
                   //radioButtons= new JRadioButton("Board " + (i+1)); // this is not a valid JRadioButton constructor
                   // I guess this is what your trying to do
                   JRadioButton r = new JRadioButton("Board ");
                   r.setActionCommand("yesnno"+i);
                   r.setBackground(Color.blue);
                   r.setForeground(Color.white);
                   r.setBorder(titled);
                   radioButtons[i] = r;
              radioButtons[0].setSelected(true);
              labels = new JLabel("YADA YADA");     
              pane.add(labels); // Just a remark...labels will be null...never initialized add something like the row above
              for(int i=0;i<boardChoice;i++)
              {     //pane.add(radioButtons); // Since 'radioButtons isn't qualified as a component this will not work
                   // This will - since the elements of the arrays are the radiobuttons from above for-loop
                   pane.add(radioButtons);
              String colortext = "Choose your Board ";
              JLabel coloredLabel = new JLabel(colortext);
              titled.setTitleColor(Color.white);
         JButton random = new JButton("Random");
              pane.add(random);
              pane.setBorder(titled);
         //     ///////////////////////////////////////////////////////second radio buton///////////////
              JPanel timerpane = new JPanel();
              timerpane.setBackground(Color.blue);
              JRadioButton[] timerButtons = new JRadioButton[2];
              final ButtonGroup grouptimer = new ButtonGroup();
              timerButtons[0]= new JRadioButton("On");
              timerButtons[0].setActionCommand("yes");
              timerButtons[1]= new JRadioButton("Off");
              timerButtons[1].setActionCommand("no");
              timerButtons[0].setSelected(true);
              for(int i=0;i<2;i++)
                   // To distinguish each button from an array like this you need (as you have done above the loop)
                   // to add the brackets containing the proper element
                   timerButtons[i].setBackground(Color.blue);
                   timerButtons[i].setForeground(Color.white);
              for(int i=0;i<2;i++)
                   timerpane.add(timerButtons[i]); // Like above
              TitledBorder stitled = new TitledBorder("Timer");
              timerpane.setBorder(stitled);
              stitled.setTitleColor(Color.white);
              slider.setMajorTickSpacing(1);
              slider.setPaintTicks(true);
              slider.setPaintLabels(true);
              slider.setBackground(Color.blue);
              slider.setForeground(Color.white);
              slider.setLabelTable(slider.createStandardLabels(1));
              paneslider.setBackground(Color.blue);
              paneslider.add(slider);//,new BoxLayout.LINE_AXIS);
              TitledBorder titled1 = new TitledBorder("Select Time");
              titled1.setTitleColor(Color.white);
              paneslider.setBorder(titled1);
              JPanel musicpane = new JPanel();
              JRadioButton[] musicButtons = new JRadioButton[2];
              musicpane.setBackground(Color.blue);
              final ButtonGroup groupmusic = new ButtonGroup();
              musicButtons[0]= new JRadioButton("On");
              musicButtons[0].setActionCommand("yesmusic");
              musicButtons[1]= new JRadioButton("Off");
              musicButtons[1].setActionCommand("nomusic");
              musicButtons[1].setSelected(true);
              for(int i=0;i<2;i++)
    //               Like above
                   musicButtons[i].setBackground(Color.blue);
                   musicButtons[i].setForeground(Color.white);
         //     slider.setMinorTickSpacing(1);
              for(int i=0;i<2;i++)
                   musicpane.add(musicButtons[i]); // Like above
              TitledBorder mtitled = new TitledBorder("Music");
              mtitled.setTitleColor(Color.white);
              musicpane.setBorder(mtitled);
              JPanel levelpane = new JPanel();
              levelpane.setBackground(Color.blue);
              JRadioButton[] levelButtons = new JRadioButton[2];
              final ButtonGroup grouplevel = new ButtonGroup();
              levelButtons[0]= new JRadioButton("Professional");
              levelButtons[0].setActionCommand("yeslevel");
              levelButtons[1]= new JRadioButton("Family");
              levelButtons[1].setActionCommand("nolevel");
              for(int i=0;i<2;i++)
                   levelButtons[i].setBackground(Color.blue); // Like above
                   levelButtons[i].setForeground(Color.white);
              levelButtons[0].setSelected(true);
              for(int i=0;i<2;i++)
                   levelpane.add(levelButtons[i]); // Like above
              TitledBorder ltitled = new TitledBorder("Choose Competency");
              ltitled.setTitleColor(Color.white);
              levelpane.setBorder(ltitled);
         //     ///////////////////////////////////////////Butttons
              JPanel buttonpane = new JPanel();
              buttonpane.setBackground(Color.blue);
              JButton startButton = new JButton("Play");
              JButton defaultButton = new JButton("Default");
              JButton exitButton = new JButton("Exit");
              startButton.setBackground(Color.blue);
              startButton.setForeground(Color.white);
              buttonpane.add(startButton);
              defaultButton.setBackground(Color.blue);
              defaultButton.setForeground(Color.white);
              buttonpane.add(defaultButton);
              exitButton.setBackground(Color.blue);
              exitButton.setForeground(Color.white);
              buttonpane.add(exitButton);
              Container contentPane = f.getContentPane();
              contentPane.setLayout(new BoxLayout(contentPane,BoxLayout.Y_AXIS));
              contentPane.add(pane);
              contentPane.add(timerpane);
              contentPane.add(musicpane);
              contentPane.add(paneslider);
              contentPane.add(levelpane);
              contentPane.add(buttonpane);
         public static void main(String[] args) {
              new WordigoGUI();
    /k

  • Radiobutton in output screen

    i want radiobutton in my output screen , can anyone help me out how can i add this to my out put screen.

    Hi
    see this report and you can understand very easily
    in this report some extra feture also available
    *& Report  ZNNR_REPORT
    REPORT  ZNNR_REPORT NO STANDARD PAGE HEADING MESSAGE-ID ZNNR LINE-SIZE 100 LINE-COUNT 65(4).
    ******DATA DECLARATIONS**********
    DATA : BEGIN OF IT_PLANT OCCURS 0,
            MATNR LIKE MARA-MATNR,
            WERKS LIKE MARC-WERKS,
            PSTAT LIKE MARC-PSTAT,
            EKGRP LIKE MARC-EKGRP,
           END OF IT_PLANT.
    DATA : BEGIN OF IT_PONO OCCURS 0,
            EBELN LIKE EKKO-EBELN,
            EBELP LIKE EKPO-EBELP,
            MATNR LIKE EKPO-MATNR,
            WERKS LIKE EKPO-WERKS,
            LGORT LIKE EKPO-LGORT,
           END OF IT_PONO.
    TABLES EKKO.
    ********END OF DATA DECLARATIONS*********
    ********SELECTION SCREEN DESIGN ***********
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETER : P_WERKS LIKE MARC-WERKS MODIF ID S1.
    SELECT-OPTIONS : S_EBELN FOR EKKO-EBELN NO INTERVALS MODIF ID S2.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-004.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : R1 RADIOBUTTON GROUP G1 DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 5(20) TEXT-002 FOR FIELD R1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : R2 RADIOBUTTON GROUP G1.
    SELECTION-SCREEN COMMENT 5(20) TEXT-003 FOR FIELD R2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK B2.
    ******END OF SELECTION SCREEN DESIGN****************
    *********INITIALIZATION OF SELECTION SCREEN ELEMENTS.*****
    INITIALIZATION.
    P_WERKS = '1000'.
    S_EBELN-LOW = '4500016926'.
    S_EBELN-OPTION = 'EQ'.
    S_EBELN-SIGN = 'I'.
    APPEND S_EBELN.
    CLEAR S_EBELN.
    ************END OF INITIALIZATION***********************
    ***********SCREEN MODIFICATIONS*******************
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF R1 EQ 'X' AND SCREEN-GROUP1 EQ 'S2'.
          SCREEN-INPUT = 0.
          MODIFY SCREEN.
        ENDIF.
        IF R2 EQ 'X' AND SCREEN-GROUP1 EQ 'S1'.
          SCREEN-INPUT = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    ********END OF SCREEN MODIFICATIONS*****************
    ***************SCREEN VALIDATIONS *****************
    at selection-screen.
      SELECT SINGLE *
               FROM EKKO
               INTO EKKO
               WHERE EBELN IN S_EBELN.
      IF SY-SUBRC <> 0.
        SET CURSOR FIELD 'S_EBELN-LOW'.
        MESSAGE E999 WITH TEXT-005.
      ENDIF.
    ********end of screen validation*****************
    START-OF-SELECTION.
    *set pf-status '100'.
      IF R1 EQ 'X'.
        SELECT MATNR
               WERKS
               PSTAT
               EKGRP
           FROM MARC
           INTO TABLE IT_PLANT
           WHERE WERKS = P_WERKS.
        LOOP AT IT_PLANT.
          WRITE : SY-VLINE , 2 IT_PLANT-MATNR COLOR COL_KEY,
                 21 SY-VLINE , 22  IT_PLANT-WERKS COLOR COL_KEY,
                 27 SY-VLINE ,28 IT_PLANT-PSTAT COLOR COL_NORMAL,
                 43 SY-VLINE ,44 IT_PLANT-EKGRP COLOR COL_NORMAL.
        ENDLOOP.
      ENDIF.
      IF R2 EQ 'X'.
        SELECT EBELN EBELP MATNR WERKS LGORT
               FROM EKPO
               INTO TABLE IT_PONO
               WHERE EBELN IN S_EBELN.
        LOOP AT IT_PONO.
          WRITE : SY-VLINE , 2 IT_PONO-EBELN COLOR COL_KEY,
                 12 SY-VLINE , 13 IT_PONO-EBELP COLOR COL_KEY,
                 18 SY-VLINE , 19 IT_PONO-MATNR COLOR COL_NORMAL,
                 37 SY-VLINE , 38 IT_PONO-WERKS COLOR COL_NORMAL,
                 44 SY-VLINE , 45 IT_PONO-LGORT COLOR COL_NORMAL, 49 SY-VLINE..
        ENDLOOP.
      ENDIF.
    TOP-OF-PAGE.
      IF R1 EQ 'X'.
    *ULINE AT /1(48).
        WRITE : SY-VLINE ,2 'MATERIAL NUMBER',
                21 SY-VLINE , 22 'PLANT',
                27 SY-VLINE , 28 'STATUS',
                43 SY-VLINE , 44 'GRUP', 48 SY-VLINE.
        ULINE AT /1(48).
      ENDIF.
      IF R2 EQ 'X'.
        WRITE : SY-VLINE , 2 'PO NUMBER',
               12 SY-VLINE, 13 'ITEM',
               18 SY-VLINE,19 'MATERIAL NUMBER',
               37 SY-VLINE, 38 'PLANT',
               44 SY-VLINE, 45 'GRUP',
               49 SY-VLINE.
        ULINE AT /1(50).
      ENDIF.
    END-OF-PAGE.
      ULINE AT /1(50).
      WRITE :/10 'PAGE NUMBER', SY-PAGNO.

  • Setting UI Colors

    I like the metal look and feel but our corporate colors are green rather than blue. I have played around with setting the various UIManager.put properties but after 20 or so I am still missing some.
    Is there an easier way to tell the UI manager what color scheme to use? Something like a base color, from which all gradients, etc. can be derived from, would be much easier.
    It just seems like there should be an easier way than this:
    ArrayList<Object> gradients = new ArrayList<Object>(5);
    gradients.add(0.28f);
    gradients.add(0.00f);
    gradients.add(new Color(0x33FF00));
    gradients.add(new Color(0x33CC00));
    gradients.add(new Color(0x339900));
    UIManager.put("Button.gradient", gradients);
    UIManager.put("CheckBox.gradient", gradients);
    UIManager.put("CheckBoxMenuItem.gradient", gradients);
    UIManager.put("MenuBar.gradient", gradients);
    UIManager.put("ScrollBar.gradient", gradients);
    UIManager.put("RadioButton.gradient", gradients);
    Color menuColor = new Color(0x33CC00);
    UIManager.put("Menu.selectionBackground", menuColor);
    UIManager.put("MenuItem.selectionBackground", menuColor);
    UIManager.put("TextField.selectionBackground", menuColor);
    UIManager.put("TextField.highlight", menuColor);
    UIManager.put("Tree.selectionForeground", menuColor);
    UIManager.put("Tree.selectionBackground", menuColor);
    UIManager.put("List.selectionBackground", menuColor);
    UIManager.put("TabbedPane.selectHighlight", menuColor);
    UIManager.put("TabbedPane.selected", menuColor);
    UIManager.put("TabbedPane.shadow", menuColor);
    UIManager.put("TabbedPane.borderHighlightColor", menuColor);
    UIManager.put("ComboBox.selectionBackground", menuColor);

    Search the forum for my ShowUIDefaults class which lists all the UI properties. Then try clicking on the "System Colors" tab. I've never tried it, but maybe by changing those colors you will globally affect each component. I'm using JDK1.4.2, which doesn't have a "gradient" property so I don't know if you will find any additional support for that property or not.

  • Button color used make it other button next

    Hello ppl :-)
    i got 3 Radiobuttons 
    1 makes it blue 
    1 makes it red
    1 makes it white 
    got 4 buttons 
    i have made it so if i press button 1 it moves to button 4
    the problem is i want it to if buttons 4 is blue 
    and i select blue or red by radiobuttons again clicking button 1 and it should
    auto put it in button 3 becuse button 4 is full 
    and again if i pick radiobutton ( white ) click button 4 
    so it clears .... 
    it should move button 3-2-1 becuse they are full to 4-3-2
    leaveing button 1 clear 
    any 1 got some ideas would be great 
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    If RadioButton1.Checked Then
    Button1.BackColor = Color.Blue
    End If
    If RadioButton2.Checked Then
    Button1.BackColor = Color.Red
    End If
    If RadioButton3.Checked Then
    Button1.BackColor = Color.White
    End If
    Dim colour As Color = Button2.BackColor
    Button2.BackColor = Button1.BackColor
    Button1.BackColor = colour
    Button3.BackColor = Button2.BackColor
    Button2.BackColor = colour
    Button4.BackColor = Button3.BackColor
    Button3.BackColor = colour
    My.Settings.Save()
    End Sub

    The description is unclear you saying: 
    "if buttons 4 is blue 
    and i select blue or red by radiobuttons again clicking button 1 and it should
    auto put it in button 3 becuse button 4 is full :"
    What if red is selected why don't you change the button 3 and 4 to red?
    Also I would like to suggest another scenario is to fire the event when changing the values of the radios and not on clicking button1. For example if I have two radios Red and Blue I will put them both in a GroupBox control(you may need to right click the group
    box and click send to back if you add it after the radios to the form):
    and also in the "Tag" property of of the radio I will add the related color name to it (to add the tag property select the radio button and go to properties and fill the Tag with the related color: Red for example".
    Then on ChekcedChanged event of the radios I will be able to read that Tag value and convert it to color and then assign to the button.
    Events example:
    Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton1.CheckedChanged
    If RadioButton1.Checked = True Then
    Dim clr As Color = Color.FromName(RadioButton1.Tag)
    Button1.BackColor = clr
    End If
    End Sub
    Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton2.CheckedChanged
    If RadioButton2.Checked = True Then
    Dim clr As Color = Color.FromName(RadioButton2.Tag)
    Button1.BackColor = clr
    End If
    End Sub
    Fouad Roumieh

Maybe you are looking for

  • Using Toplink with Servlets in a Clustered application server

    I am having some problems with Toplink. Basically, I have a collection of HttpServlets that manipulate a domain object and its various collections of objects. The general technique is to place the domain object in the HttpSession, and have each Servl

  • Best Way To Cut Texture From Logo Graphic?

    Hello. Can someone please advise me on the best way to CUT a texture from a graphic AND still be able to use mutiple colors on the new graphic? To more specifically illustrate my question/problem, here are the steps I've taken: 1) I created a map gra

  • No value found for Organizational Unit BILL_ORG

    Hi Experts, I am creating a Service transaction - Incident and then creating a follow up document (RFC). Upon saving the follow up document the system shows the following error: An error occurred in system FEDCLNT200 during account assignment Message

  • My games wont work no !!!!!!!!

    I have downloaded games in the past, but I saw a free game called Iquiz maker, and I thought it would be helpful for college tests. I downloaded it fine and I can run it, but when it comes to syncing it to the I-pod it's different. Do I have the buy

  • Data load on database..

    hi, can any one tell me which area should i check to check the load of data on database? Regards, Bichu.