How to add vertical scrollbar to a tree region

Hi,
I have a page containing two regions. The first is a tree region displayed on the left hand side of the page. The second is form region displayed to the right of the tree, showing details relating to the selected node from the tree.
How can I add a vertical scrollbar to the tree, so that I can I browse all nodes in the tree without affecting the position of the form? Currently, if my tree extends beyond the height of the page I have to use the page vertical scrollbar to view the bottom of the tree. This obviously means that the form is no longer in view.
Thanks
Andrew.

Hi Andrew,
You can't add a scrollbar directly to the region's contents, but you can wrap the contents within a DIV tag.
In the Region Header add in:
<DIV style="height:500px; overflow:auto">
In the Region Footer add in:
</DIV>
Obviously, change the height value to suit your needs.
Regards
Andy

Similar Messages

  • How to create vertical Scrollbar in table control?

    Dear All,
    How to create vertical scrollbar in table controll.?
    regards,
    Dharmesh

    Hi
    It should be created automatically, if you can't see it, try to set the field lines of table control
    PROCESS PBO
    MODULE SET_ATTR_TC.
    LOOP AT ITAB WITH .....
    ENDLOOP.
    MODULE SET_ATTR_TC.
    DESCRIBE TABLE ITAB LINES SY-TABIX.
    <TABLE CONTROL>-LINES = SY-TABIX.
    ENDMODULE.
    Max

  • How to add vertical stroke to between top menu items?

    I have a horizontal Spry menu bar. How to add a vertical stroke between menu top items?
    BUT NOT outermost left and outermost right. Only to BETWEEN top menu items.
    In html file I tried this:
      <div id="main_menu">
        <ul id="MenuBar1" class="MenuBarHorizontal">
          <li><a href="#">Products</a></li>
          <li class=stroke></li>
          <li><a href="#">Services</a></li>
          <li class=stroke></li>
          <li><a href="#">News</a></li>
          <li class=stroke></li>
          <li><a href="#">Contact</a></li>
         </ul>
       </div>
    And in CSS-file I made a style:
    #MenuBar1 .stroke
    display: block;
    width: 1px;
    height: 16px;
    background-image: url(../images/gui/vertical_stroke.png);
    background-repeat: no-repeat;
    In Safari this Spry menu bar work fine. But stop working in Firefox and IE.
    Also DW4 warning me in properties panel that:
    "This menu bar is missing some important tags. Go to Code view and and make sure that each menu item contains an <a> tag."
    What is correct method to do this?

    In that case you will need to use images.
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>Untitled</title>
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css">
    <style>
    ul.MenuBarHorizontal a.line {    background: #EEE url(SpryMenuBarLine.gif) no-repeat 95% 50%; }
    ul.MenuBarHorizontal a.MenuBarItemSubmenu.line{    background: #EEE url(SpryMenuBarDownLine.gif) no-repeat 95% 50%; }
    </style>
    </head>
    <body>
    <ul id="MenuBar1" class="MenuBarHorizontal">
      <li><a class="MenuBarItemSubmenu line" href="#">Item 1</a>
        <ul>
          <li><a href="#">Item 1.1</a></li>
          <li><a href="#">Item 1.2</a></li>
          <li><a href="#">Item 1.3</a></li>
        </ul>
      </li>
      <li><a href="#" class="line">Item 2</a></li>
      <li><a class="MenuBarItemSubmenu line" href="#">Item 3</a>
        <ul>
          <li><a class="MenuBarItemSubmenu" href="#">Item 3.1</a>
            <ul>
              <li><a href="#">Item 3.1.1</a></li>
              <li><a href="#">Item 3.1.2</a></li>
            </ul>
          </li>
          <li><a href="#">Item 3.2</a></li>
          <li><a href="#">Item 3.3</a></li>
        </ul>
      </li>
      <li><a href="#">Item 4</a></li>
    </ul>
    <script type="text/javascript">
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    </script>
    </body>
    </html>
    The images look similar to the following
    and
    I hope this helps.
    Ben

  • How to add keyboard control on our tree.

    hi,
    any body can kindly tell me that how can we add keyboard control on out tree widget.
    I am also anxious to know that when I compiled and loaded the PnlTreeView sample in Debug mode, keyboard control on this panel was also not working fine, it worked sometime and not on the other.
    Can anybody help me for the above 2 questions.

    There's no calendar control per-se, but you have an option - create an HTML image-map prompt - that should work....the only problem would be making it dynamic, but I'm sure you can create a big image map

  • Scroll down programmatically the vertical scrollbar in hierarchical trees

    I manually select nodes in the tree. When the node is expanded the leaf nodes doesn4t appear on the screen. Then
    I have to scroll down the vertical scrollbar to see it.
    Is it possible to scroll the tree so that the selected node
    appears on the screen ??
    My forms version is 6.0.8.19.2
    Best regards

    You can make use of the property "Index Vals" and write a new value to the Table as shown below
    Regards
    Guru (CLA)
    Attachments:
    1.png ‏23 KB
    1.png ‏23 KB

  • How to add a report into the tree??

    Hi all,
    Pls help me add a report into the tree same as standard report that we can click icon on tree to run.
    Thank you!

    Hi,
    use FM HR_ALV_HIERSEQ_LIST_DISPLAY
    there are 2 internal table , one for header and one for detail
    below is code for reference
    REPORT zinsd_quot_cont.
    TYPES : BEGIN OF ty_vbak,
    vbeln TYPE vbeln_va,
    vkorg TYPE vkorg,
    vtweg TYPE vtweg,
    spart TYPE spart,
    vkbur TYPE vkbur,
    vkgrp TYPE vkgrp,
    angdt TYPE angdt_v,
    bnddt TYPE bnddt,
    kunnr TYPE kunnr,
    kwmeng TYPE kwmeng,
    meins TYPE meins,
    kunwe TYPE kunnr,
    name1 TYPE name1_gp ,
    name2 TYPE name1_gp ,
    sel(1),
    expand(1),
    salesdocument TYPE bapivbeln-vbeln,
    message TYPE bapi_msg,
    END OF ty_vbak.
    DATA : w_vbak TYPE ty_vbak,
    t_vbak TYPE TABLE OF ty_vbak.
    DATA : w_update TYPE ty_vbak,
    t_update TYPE TABLE OF ty_vbak.
    TYPES : BEGIN OF ty_kna1,
    kunnr TYPE kunnr,
    name1 TYPE name1_gp ,
    END OF ty_kna1.
    DATA : w_kna1 TYPE ty_kna1,
    t_kna1 TYPE TABLE OF ty_kna1.
    TYPES : BEGIN OF ty_vbap,
    vbeln TYPE vbeln_va,
    posnr TYPE posnr_va,
    matnr TYPE matnr,
    matkl TYPE matkl,
    werks TYPE werks_ext,
    kwmeng TYPE kwmeng,
    meins TYPE meins,
    mvgr5 TYPE mvgr5,
    maktx TYPE maktx,
    END OF ty_vbap.
    DATA : w_vbap TYPE ty_vbap,
    t_vbap TYPE TABLE OF ty_vbap.
    TYPES : BEGIN OF ty_makt,
    matnr TYPE matnr,
    maktx TYPE maktx,
    END OF ty_makt.
    DATA : w_makt TYPE ty_makt,
    t_makt TYPE TABLE OF ty_makt.
    TYPES : BEGIN OF ty_sum,
    vbeln TYPE vbeln_va,
    kwmeng TYPE kwmeng,
    END OF ty_sum.
    DATA : w_sum TYPE ty_sum,
    t_sum TYPE TABLE OF ty_sum.
    TYPES : BEGIN OF ty_vbpa,
    vbeln TYPE vbeln,
    posnr TYPE posnr,
    parvw TYPE parvw,
    kunnr TYPE kunnr,
    END OF ty_vbpa.
    DATA : w_vbpa TYPE ty_vbpa,
    t_vbpa TYPE TABLE OF ty_vbpa.
    TYPES : BEGIN OF ty_vbup,
    vbeln TYPE vbeln,
    posnr TYPE posnr ,
    gbsta TYPE gbsta ,
    END OF ty_vbup.
    DATA : w_vbup TYPE ty_vbup,
    t_vbup TYPE TABLE OF ty_vbup.
    TYPE-POOLS slis.
    DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv,
    w_fieldcatalog TYPE slis_fieldcat_alv,
    w_layout TYPE slis_layout_alv,
    gs_keyinfo TYPE slis_keyinfo_alv.
    DATA: g_tabname_header TYPE slis_tabname,
    g_tabname_item TYPE slis_tabname.
    data definition
    Batchinputdata of single transaction
    DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
    messages of call transaction
    DATA: messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
    DATA : g_lines TYPE i.
    *Selection Screen
    TABLES : vbak,vbap.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
    SELECT-OPTIONS s_vkorg FOR vbak-vkorg. " Sales Org
    SELECT-OPTIONS s_vtweg FOR vbak-vtweg. " Dist Channel
    SELECT-OPTIONS s_spart FOR vbak-spart. " Division
    SELECT-OPTIONS s_vkbur FOR vbak-vkbur. " Sales Off
    SELECT-OPTIONS s_vkgrp FOR vbak-vkgrp. " Sales Grp
    SELECT-OPTIONS s_matkl FOR vbap-matkl. " Mat Grp
    SELECT-OPTIONS s_werks FOR vbap-werks. " Plant
    SELECT-OPTIONS s_period FOR vbak-angdt. " Sales Off
    SELECTION-SCREEN END OF BLOCK b1.
    START-OF-SELECTION.
    PERFORM f_getdata.
    PERFORM f_initdata.
    END-OF-SELECTION.
    PERFORM f_createalv.
    PERFORM f_dispalv.
    *& Form f_getdata
    text
    --> p1 text
    <-- p2 text
    FORM f_getdata .
    *Sales Header
    SELECT
    vbeln
    vkorg
    vtweg
    spart
    vkbur
    vkgrp
    angdt
    bnddt
    kunnr
    INTO TABLE t_vbak
    FROM vbak
    WHERE
    vkorg IN s_vkorg " Sales Org
    AND vtweg IN s_vtweg " Dist Channel
    AND spart IN s_spart " Division
    AND vkbur IN s_vkbur " Sales Off
    AND vkgrp IN s_vkgrp " Sales Grp
    AND angdt IN s_period
    AND bnddt IN s_period
    AND auart = 'ZQMO'
    AND vbtyp = 'B'.
    *CUST NAME
    SELECT
    kunnr
    name1
    INTO TABLE t_kna1
    FROM kna1
    FOR ALL ENTRIES IN t_vbak
    WHERE
    kunnr = t_vbak-kunnr
    *Sales Item
    SELECT
    vbeln
    posnr
    matnr
    matkl
    werks
    kwmeng
    meins
    mvgr5
    INTO TABLE t_vbap
    FROM vbap
    FOR ALL ENTRIES IN t_vbak
    WHERE
    vbeln = t_vbak-vbeln
    AND matkl IN s_matkl " Mat Grp
    AND werks IN s_werks " Plant
    *Partners
    SELECT
    vbeln
    posnr
    parvw
    kunnr
    INTO TABLE t_vbpa
    FROM vbpa
    FOR ALL ENTRIES IN t_vbak
    WHERE
    vbeln = t_vbak-vbeln.
    IF t_vbpa[] IS NOT INITIAL.
    SELECT
    kunnr
    name1
    APPENDING TABLE t_kna1
    FROM kna1
    FOR ALL ENTRIES IN t_vbpa
    WHERE
    kunnr = t_vbpa-kunnr
    ENDIF.
    *Status - Sales Doc
    SELECT
    vbeln
    posnr
    gbsta
    INTO TABLE t_vbup
    FROM vbup
    FOR ALL ENTRIES IN t_vbap
    WHERE
    vbeln = t_vbap-vbeln
    AND posnr = t_vbap-posnr
    AND gbsta NE 'C'.
    SELECT
    matnr
    maktx
    INTO TABLE t_makt
    FROM makt
    FOR ALL ENTRIES IN t_vbap
    WHERE
    matnr = t_vbap-matnr
    AND spras = 'E'.
    ENDFORM. " f_getdata
    *& Form f_initdata
    text
    --> p1 text
    <-- p2 text
    FORM f_initdata .
    SORT t_vbap BY vbeln DESCENDING.
    *delete all closed stat items
    LOOP AT t_vbap INTO w_vbap.
    READ TABLE t_vbup INTO w_vbup
    WITH KEY
    vbeln = w_vbap-vbeln
    posnr = w_vbap-posnr.
    IF sy-subrc <> 0.
    DELETE t_vbap.
    CONTINUE.
    ELSE.
    READ TABLE t_makt INTO w_makt
    WITH
    KEY matnr = w_vbap-matnr.
    IF sy-subrc = 0.
    w_vbap-maktx = w_makt-maktx.
    MODIFY t_vbap FROM w_vbap.
    ENDIF.
    ENDIF.
    ENDLOOP.
    *find the total quantity
    LOOP AT t_vbap INTO w_vbap.
    w_sum-vbeln = w_vbap-vbeln.
    w_sum-kwmeng = w_vbap-kwmeng.
    COLLECT w_sum INTO t_sum.
    CLEAR w_sum.
    ENDLOOP.
    *populate header
    LOOP AT t_vbak INTO w_vbak.
    Quantity - Total
    READ TABLE t_sum INTO w_sum
    WITH KEY
    vbeln = w_vbak-vbeln.
    IF sy-subrc = 0.
    w_vbak-kwmeng = w_sum-kwmeng.
    ELSE.
    CLEAR w_vbak-kwmeng.
    ENDIF.
    UoM
    READ TABLE t_vbap INTO w_vbap
    WITH KEY
    vbeln = w_vbak-vbeln.
    IF sy-subrc = 0.
    w_vbak-meins = w_vbap-meins.
    ELSE.
    CLEAR w_vbak-meins.
    ENDIF.
    Partner
    READ TABLE t_vbpa INTO w_vbpa
    WITH KEY
    vbeln = w_vbak-vbeln
    parvw = 'WE'.
    IF sy-subrc = 0.
    w_vbak-kunwe = w_vbpa-kunnr.
    ELSE.
    CLEAR w_vbak-kunwe.
    ENDIF.
    SHIP TO PARTY NAME
    READ TABLE t_kna1 INTO w_kna1
    WITH KEY
    kunnr = w_vbak-kunwe.
    IF sy-subrc = 0.
    w_vbak-name2 = w_kna1-name1.
    ENDIF.
    CUST NAM - SOLD TO PARTY
    READ TABLE t_kna1 INTO w_kna1
    WITH KEY
    kunnr = w_vbak-kunnr.
    IF sy-subrc = 0.
    w_vbak-name1 = w_kna1-name1.
    ENDIF.
    MODIFY t_vbak FROM w_vbak.
    ENDLOOP.
    DELETE t_vbak WHERE kwmeng IS INITIAL.
    SORT t_vbak BY vbeln DESCENDING.
    SORT t_vbap BY vbeln DESCENDING posnr ASCENDING.
    ENDFORM. " f_initdata
    *& Form f_createalv
    Create Field Cat.
    --> p1 text
    <-- p2 text
    FORM f_createalv .
    g_tabname_header = 't_vbak'.
    g_tabname_item = 't_vbap' .
    CLEAR gs_keyinfo.
    gs_keyinfo-header01 = 'VBELN'.
    gs_keyinfo-item01 = 'VBELN'.
    *VBAK
    w_fieldcatalog-fieldname = 'VBELN'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'Sales Document'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'VKORG'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'Sales Org'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'VTWEG'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'Dist Channel'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'SPART'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'Division'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'VKBUR'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'Sales Office'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'VKGRP'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'Sales GRP'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'KUNNR'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'Sold to Party'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'NAME1'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-outputlen = 35.
    w_fieldcatalog-seltext_l = 'Sold to Party Code - Name'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'KUNWE'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'Ship to Party'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'NAME2'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'Ship Party Code - Name'.
    w_fieldcatalog-outputlen = 35.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'KWMENG'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'Quantity'.
    w_fieldcatalog-outputlen = 25.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'MEINS'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'UoM'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'SALESDOCUMENT'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'Document'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'MESSAGE'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'Log'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    *VBAP
    w_fieldcatalog-fieldname = 'POSNR'.
    w_fieldcatalog-tabname = 't_vbap'.
    w_fieldcatalog-seltext_l = 'POS'.
    w_fieldcatalog-outputlen = 6.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'MATNR'.
    w_fieldcatalog-tabname = 't_vbap'.
    w_fieldcatalog-seltext_l = 'Material'.
    w_fieldcatalog-outputlen = 18.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'MAKTX'.
    w_fieldcatalog-tabname = 't_vbap'.
    w_fieldcatalog-seltext_l = 'Material Desc'.
    w_fieldcatalog-outputlen = 40.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'MATKL'.
    w_fieldcatalog-tabname = 't_vbap'.
    w_fieldcatalog-seltext_l = 'Material Grp'.
    w_fieldcatalog-outputlen = 9.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'MVGR5'.
    w_fieldcatalog-tabname = 't_vbap'.
    w_fieldcatalog-seltext_l = 'MCNO'.
    w_fieldcatalog-outputlen = 4.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'WERKS'.
    w_fieldcatalog-tabname = 't_vbap'.
    w_fieldcatalog-seltext_l = 'Plant'.
    w_fieldcatalog-outputlen = 91.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'KWMENG'.
    w_fieldcatalog-tabname = 't_vbap'.
    w_fieldcatalog-seltext_l = 'Quantity'.
    w_fieldcatalog-outputlen = 25.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'MEINS'.
    w_fieldcatalog-tabname = 't_vbap'.
    w_fieldcatalog-seltext_l = 'UoM'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    LAYOUT
    w_layout-colwidth_optimize = 'X'.
    w_layout-zebra = 'X'.
    w_layout-expand_fieldname = 'EXPAND'.
    w_layout-box_fieldname = 'SEL'.
    w_layout-box_tabname = 't_vbak'.
    ENDFORM. " f_createalv
    *& Form f_dispalv
    Call ALV
    --> p1 text
    <-- p2 text
    FORM f_dispalv .
    CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
    EXPORTING
    i_callback_program = sy-repid
    i_callback_pf_status_set = 'SET_PF_STATUS'
    i_callback_user_command = 'USER_COMMAND'
    is_layout = w_layout
    it_fieldcat = t_fieldcatalog
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    IT_EVENTS =
    IT_EVENT_EXIT =
    i_tabname_header = g_tabname_header
    i_tabname_item = g_tabname_item
    is_keyinfo = gs_keyinfo
    TABLES
    t_outtab_header = t_vbak
    t_outtab_item = t_vbap
    EXCEPTIONS
    program_error = 1
    OTHERS = 2
    IF sy-subrc <> 0.
    ENDIF.
    ENDFORM. " f_dispalv
    *& Form set_pf_status
    PF stat
    -->RT_EXTAB text
    FORM set_pf_status USING rt_extab TYPE slis_t_extab.
    SET PF-STATUS 'ZINSD_QUOT_CONT_ST'.
    ENDFORM. "set_pf_status
    *& Form user_command
    Process List UCOMM
    -->R_UCOMM text
    -->RS_SELFIELD text
    FORM user_command USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
    REFRESH t_update.
    IF r_ucomm = 'EXIT'.
    LEAVE PROGRAM.
    ENDIF.
    IF r_ucomm = 'EXECUTE'.
    LOOP AT t_vbak INTO w_update
    WHERE
    sel = 'X'
    AND salesdocument = ' '.
    APPEND w_update TO t_update.
    ENDLOOP.
    IF t_update[] IS NOT INITIAL.
    LOOP AT t_update INTO w_update.
    PERFORM f_bapi_contract_createfromdata USING w_update.
    PERFORM f_bdc_contract_from_quotation.
    MODIFY t_update FROM w_update.
    ENDLOOP.
    ELSE.
    ENDIF.
    PERFORM f_dispalv.
    ENDIF.
    IF r_ucomm = '&IC1'.
    IF rs_selfield-sel_tab_field = 't_vbak-VBELN'.
    SET PARAMETER ID 'AGN' FIELD rs_selfield-value.
    CALL TRANSACTION 'VA23' AND SKIP FIRST SCREEN.
    ENDIF.
    IF rs_selfield-sel_tab_field = 't_vbak-SALESDOCUMENT' AND
    rs_selfield-value NE ' '.
    SET PARAMETER ID 'KTN' FIELD rs_selfield-value.
    CALL TRANSACTION 'VA43' AND SKIP FIRST SCREEN.
    ENDIF.
    ENDIF.
    ENDFORM. "user_command
    *& Form F_BAPI_CONTRACT_CREATEFROMDATA
    BAPI CALL
    -->P_W_UPDATE text
    FORM f_bapi_contract_createfromdata USING p_w_update STRUCTURE w_update .
    DATA : w_contract_header_in TYPE bapisdhd1 ,
    w_contract_header_inx TYPE bapisdhd1x ,
    t_contract_items_in TYPE TABLE OF bapisditm WITH HEADER LINE,
    t_contract_items_inx TYPE TABLE OF bapisditmx WITH HEADER LINE,
    t_contract_partners TYPE TABLE OF bapiparnr WITH HEADER LINE,
    t_return TYPE TABLE OF bapiret2 WITH HEADER LINE.
    CLEAR : w_contract_header_in,
    w_contract_header_inx.
    REFRESH : t_contract_items_in,
    t_contract_items_inx,
    t_contract_partners,
    t_return.
    w_contract_header_in-doc_type = 'ZCNT'.
    w_contract_header_in-sales_org = p_w_update-vkorg.
    w_contract_header_in-distr_chan = p_w_update-vtweg.
    w_contract_header_in-division = p_w_update-spart.
    w_contract_header_in-ct_valid_f = p_w_update-angdt.
    w_contract_header_in-ct_valid_t = p_w_update-bnddt.
    w_contract_header_inx-doc_type = 'X'.
    w_contract_header_inx-sales_org = 'X'.
    w_contract_header_inx-distr_chan = 'X'.
    w_contract_header_inx-division = 'X'.
    w_contract_header_inx-ct_valid_f = 'X'.
    w_contract_header_inx-ct_valid_t = 'X'.
    LOOP AT t_vbap INTO w_vbap
    WHERE
    vbeln = p_w_update-vbeln.
    t_contract_items_in-material = w_vbap-matnr.
    t_contract_items_in-plant = w_vbap-werks.
    t_contract_items_in-target_qty = w_vbap-kwmeng.
    t_contract_items_in-target_qu = w_vbap-meins.
    t_contract_items_in-ref_doc = w_vbap-vbeln.
    t_contract_items_in-ref_doc_it = w_vbap-posnr.
    t_contract_items_in-ref_doc_ca = 'B'.
    t_contract_items_in-prc_group5 = w_vbap-mvgr5.
    t_contract_items_inx-material = 'X'.
    t_contract_items_inx-plant = 'X'.
    t_contract_items_inx-target_qty = 'X'.
    t_contract_items_inx-target_qu = 'X'.
    t_contract_items_inx-ref_doc = 'X'.
    t_contract_items_inx-ref_doc_it = 'X'.
    t_contract_items_inx-ref_doc_ca = 'X'.
    t_contract_items_inx-prc_group5 = 'X'.
    APPEND t_contract_items_in.
    APPEND t_contract_items_inx.
    ENDLOOP.
    LOOP AT t_vbpa INTO w_vbpa
    WHERE
    vbeln = p_w_update-vbeln.
    AND posnr = w_vbap-posnr.
    t_contract_partners-partn_role = w_vbpa-parvw.
    t_contract_partners-partn_numb = w_vbpa-kunnr.
    t_contract_partners-itm_number = w_vbpa-posnr.
    APPEND t_contract_partners.
    ENDLOOP.
    CALL FUNCTION 'BAPI_CONTRACT_CREATEFROMDATA'
    EXPORTING
    SALESDOCUMENTIN =
    contract_header_in = w_contract_header_in
    contract_header_inx = w_contract_header_inx
    SENDER =
    BINARY_RELATIONSHIPTYPE = ' '
    INT_NUMBER_ASSIGNMENT = ' '
    BEHAVE_WHEN_ERROR = ' '
    LOGIC_SWITCH =
    TESTRUN =
    CONVERT = ' '
    IMPORTING
    salesdocument = p_w_update-salesdocument
    TABLES
    return = t_return
    contract_items_in = t_contract_items_in
    contract_items_inx = t_contract_items_inx
    contract_partners = t_contract_partners
    CONTRACT_CONDITIONS_IN =
    CONTRACT_CONDITIONS_INX =
    CONTRACT_CFGS_REF =
    CONTRACT_CFGS_INST =
    CONTRACT_CFGS_PART_OF =
    CONTRACT_CFGS_VALUE =
    CONTRACT_CFGS_BLOB =
    CONTRACT_CFGS_VK =
    CONTRACT_CFGS_REFINST =
    CONTRACT_DATA_IN =
    CONTRACT_DATA_INX =
    CONTRACT_TEXT =
    CONTRACT_KEYS =
    EXTENSIONIN =
    PARTNERADDRESSES =
    IF p_w_update-salesdocument NE ' ' .
    p_w_update-message = 'SUCCESS'.
    ELSE.
    READ TABLE t_return INDEX 1.
    p_w_update-message = t_return-message.
    ENDIF.
    READ TABLE t_vbak INTO w_vbak
    WITH KEY
    vbeln = p_w_update-vbeln.
    IF sy-subrc = 0.
    MODIFY t_vbak INDEX sy-tabix FROM p_w_update .
    ENDIF.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    wait = 'X'.
    ENDFORM. " F_BAPI_CONTRACT_CREATEFROMDATA
    *& Form f_bdc_contract_from_Quotation
    BAPI CALL
    -->P_W_UPDATE text
    FORM f_bdc_contract_from_quotation.
    DATA : l_date TYPE char10.
    REFRESH : messtab, bdcdata.
    CLEAR : messtab, bdcdata.
    PERFORM bdc_dynpro USING 'SAPMV45A' '0101'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=COPY'.
    PERFORM bdc_field USING 'VBAK-AUART'
    'ZCNT'.
    PERFORM bdc_dynpro USING 'SAPLV45C' '0100'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=RANG'.
    PERFORM bdc_dynpro USING 'SAPLV45C' '0100'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=UEBR'.
    PERFORM bdc_field USING 'LV45C-VBELN'
    w_update-vbeln.
    PERFORM bdc_dynpro USING 'SAPMV45A' '4001'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=SICH'.
    IF NOT w_update-angdt IS INITIAL.
    CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
    EXPORTING
    date_internal = w_update-angdt
    IMPORTING
    date_external = l_date
    EXCEPTIONS
    date_internal_is_invalid = 1
    OTHERS = 2.
    PERFORM bdc_field USING 'VBAK-GUEBG'
    l_date.
    ENDIF.
    IF NOT w_update-bnddt IS INITIAL.
    CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
    EXPORTING
    date_internal = w_update-bnddt
    IMPORTING
    date_external = l_date
    EXCEPTIONS
    date_internal_is_invalid = 1
    OTHERS = 2.
    PERFORM bdc_field USING 'VBAK-GUEEN'
    l_date.
    ENDIF.
    CALL TRANSACTION 'VA41' USING bdcdata
    MODE 'E'
    UPDATE 'S'
    MESSAGES INTO messtab.
    break abap.
    READ TABLE messtab WITH KEY msgid = 'V1'
    msgnr = '311'.
    IF sy-subrc EQ 0.
    w_update-message = 'SUCCESS'.
    w_update-salesdocument = messtab-msgv2.
    ELSE.
    READ TABLE messtab WITH KEY msgtyp = 'E'.
    IF sy-subrc EQ 0.
    DATA : l_info TYPE einfo.
    CLEAR l_info.
    l_info-msgid = messtab-msgid.
    l_info-msgty = messtab-msgtyp.
    l_info-msgno = messtab-msgnr.
    l_info-msgv1 = messtab-msgv1.
    l_info-msgv2 = messtab-msgv2.
    l_info-msgv3 = messtab-msgv3.
    l_info-msgv4 = messtab-msgv4.
    CALL FUNCTION 'MESSAGE_GET_TEXT'
    EXPORTING
    ieinfo = l_info
    ilangu = sy-langu
    IMPORTING
    etext = w_update-message
    EXCEPTIONS
    no_t100_found = 1
    OTHERS = 2.
    ENDIF.
    ENDIF.
    READ TABLE t_vbak INTO w_vbak WITH KEY vbeln = w_update-vbeln.
    IF sy-subrc = 0.
    MODIFY t_vbak INDEX sy-tabix FROM w_update transporting message
    salesdocument.
    ENDIF.
    ENDFORM. " f_bdc_contract_from_Quotation
    Start new screen *
    FORM bdc_dynpro USING program dynpro.
    CLEAR bdcdata.
    bdcdata-program = program.
    bdcdata-dynpro = dynpro.
    bdcdata-dynbegin = 'X'.
    APPEND bdcdata.
    ENDFORM. "bdc_dynpro
    Insert field *
    FORM bdc_field USING fnam fval.
    CLEAR bdcdata.
    bdcdata-fnam = fnam.
    bdcdata-fval = fval.
    APPEND bdcdata.
    ENDFORM. "bdc_field
    Also, check the following:
    http://www.sapdevelopment.co.uk/reporting/alv/alvtree.htm
    You can get help as programs also.
    hope this helps.
    cheers,
    Hema.

  • How to make vertical scrollbar visible for listbox which shows one entry only?

    I have resized listBox to display only one entry of char* items. As there is only one item displayed vertical scrollbar is not visible. Is there a way to show the scrollbar when listbox display is sized to show only one item?
    Using up/down arrow it does scroll through other entries.
    CLD,CTD

    The only problem using ring instead of listbox is that when there is a lot of items it pulls down the ring and hids all the other GUI items behind it. 
    Real estate was one reason of using list box and displaying one value. I did change the list box as a control instead of indicator but still cant get the scrollbar funcitonality.
    ANy other suggestion, thanks!
    CLD,CTD

  • How to Add Horizontal scrollbar to JTextPane

    when i try to add Horizontal scrollbar to JTextPane it is not apperaing..plase help me..
    nagesh

    I tried in all ways
    1)HORIZONTAL_SCROLLBAR_ALWAYS and VERTICAL_SCROLLBAR_ALWAYS
    2)JTextPane textPane = new JTextPane();
    JScollPane scroller = new JScrollPane(textPane);
    or :
    3)JScollPane scroller = new JScrollPane(textPane, VERTICAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_ALWAYS);
    4)JScrollPane.setHorizontalScrollBarPolicy(
                   ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
                   JScrollPane.setVerticalScrollBarPolicy(
                   ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    and also we tried to overwrite the setbounds also, but nothing is diplaying..

  • How to add vertical line at a specified location in waveform?

    Hi,all!I made an array by generating 50 random numbers,
    they can be shown in a waveform.then i calculated the average of them.There must be a number in the array which value is the nearest to the average.I want to add
    a vertical line at the location where is the nearest number.Is that possible?
    The attached file is an incomplete vi.
    Attachments:
    add_vertical_line_waveform.vi ‏39 KB

    > I don't know if you can plot a vertical line. Me, to display this, I
    > use cursors without allowing drag.
    > Hope this will help you.
    Another way to plot a vertial line is to use inf or -inf in the
    waveform. A two point waveform a (x,y) of (3.5, 0) (3.5+dx,inf) will
    draw a vertical line from (3.5,0) upwards to the edge of the graph. It
    doesn't matter what dx is. Substituting -inf for inf should draw the
    line down. Placing one of these after the other should result in a
    vertical line from top to bottom. While on this topic, Nan should
    result in a gap in the plot.
    Greg McKaskle

  • How to add 3rd child in simple tree.

    Dear All
    I have been able to add root, child1 and child2 using class CL_GUI_SIMPLE_TREE.
    But when i try to add the child3, it gives an error 'Invalid access to database interface'. Please do let me know if there is any constraint in using CL_GUI_SIMPLE_TREE.

    Dear Walter
    Please find below the code.
    SELECT * FROM SFLIGHT INTO TABLE IT_SFLIGHT.
    IF CUST_CONTAINER IS INITIAL.
    CREATE OBJECT CUST_CONTAINER EXPORTING CONTAINER_NAME = 'CCPAR'.
    CREATE OBJECT EASY_SPLITTER EXPORTING PARENT = CUST_CONTAINER
                                     ORIENTATION = 1.
    CONTAINER1 = EASY_SPLITTER->TOP_LEFT_CONTAINER.
    CONTAINER2 = EASY_SPLITTER->BOTTOM_RIGHT_CONTAINER.
    CREATE OBJECT ALV EXPORTING I_PARENT = CONTAINER2.
    CREATE OBJECT TREE EXPORTING PARENT = CONTAINER1
                    NODE_SELECTION_MODE = CL_GUI_SIMPLE_TREE=>NODE_SEL_MODE_SINGLE.
    EVENT-EVENTID = CL_GUI_SIMPLE_TREE=>EVENTID_NODE_DOUBLE_CLICK.
    EVENT-APPL_EVENT = 'X'. " process PAI if event occurs
    APPEND EVENT TO EVENTS.
    CALL METHOD TREE->SET_REGISTERED_EVENTS EXPORTING EVENTS = EVENTS.
    IF APPLICATION IS INITIAL.
    CREATE OBJECT APPLICATION.
    SET HANDLER APPLICATION->HANDLE_DOUBLE_CLICK FOR TREE.
    ENDIF.
    PERFORM BUILD_TABLE USING NODE_TABLE.
      CALL METHOD TREE->ADD_NODES
        EXPORTING
          TABLE_STRUCTURE_NAME = 'MTREESNODE'
          NODE_TABLE           = NODE_TABLE
        EXCEPTIONS
          FAILED                         = 1
          ERROR_IN_NODE_TABLE            = 2
          DP_ERROR                       = 3
          TABLE_STRUCTURE_NAME_NOT_FOUND = 4
          OTHERS                         = 5.
      IF SY-SUBRC <> 0.
       MESSAGE A000.
      ENDIF.
    ENDIF.
    FORM BUILD_TABLE  USING  P_NODE_TABLE TYPE NODE_TABLE_TYPE.
    DATA: L_CARRTEXT TYPE TM_NODETXT,
          L_CONNTEXT TYPE TM_NODETXT,
          L_FLTEXT TYPE TM_NODETXT.
    DATA : NODE TYPE MTREESNODE.
    SORT IT_SFLIGHT BY CARRID CONNID FLDATE.
    LOOP AT IT_SFLIGHT INTO  WA_SFLIGHT.
    AT FIRST.
      NODE-NODE_KEY = 'Root'.   "#EC NOTEXT
                                " Key of the node
      CLEAR NODE-RELATKEY.      " Special case: A root node has no parent
      CLEAR NODE-RELATSHIP.     " node.
      NODE-HIDDEN = ' '.        " The node is visible,
      NODE-DISABLED = ' '.      " selectable,
      NODE-ISFOLDER = 'X'.      " a folder.
      CLEAR NODE-N_IMAGE.       " Folder-/ Leaf-Symbol in state "closed":
                                " use default.
      CLEAR NODE-EXP_IMAGE.     " Folder-/ Leaf-Symbol in state "open":
                                " use default
      CLEAR NODE-EXPANDER.      " see below.
      NODE-TEXT = 'CARRID'.
      APPEND NODE TO NODE_TABLE.
    ENDAT.
    AT NEW CARRID.
      Node with key 'Child1'
      NODE-NODE_KEY = WA_SFLIGHT-CARRID. "#EC NOTEXT
                                " Key of the node
      " Node is inserted as child of the node with key 'Root'.
      NODE-RELATKEY = 'Root'.
      NODE-RELATSHIP = CL_GUI_SIMPLE_TREE=>RELAT_LAST_CHILD.
      NODE-HIDDEN = ' '.
      NODE-DISABLED = ' '.
      NODE-ISFOLDER = 'X'.
      CLEAR NODE-N_IMAGE.
      CLEAR NODE-EXP_IMAGE.
      NODE-EXPANDER = ' '. " The node is marked with a '+', although
                           " it has no children. When the user clicks on the
                           " + to open the node, the event
                           " expand_no_children is fired. The programmer can
                           " add the children of the
                           " node within the event handler of the
                           " expand_no_children event
                           " (see method handle_expand_no_children
                           " of class lcl_application)
      NODE-TEXT = WA_SFLIGHT-CARRID.
      APPEND NODE TO NODE_TABLE.
    ENDAT.
    AT NEW CONNID.
      Node with key 'Child2'
      NODE-NODE_KEY = WA_SFLIGHT-CONNID. "#EC NOTEXT
                                " Key of the node
      " Node is inserted as child of the node with key 'Root'.
      NODE-RELATKEY = WA_SFLIGHT-CARRID.
      NODE-RELATSHIP = CL_GUI_SIMPLE_TREE=>RELAT_LAST_CHILD.
      NODE-HIDDEN = ' '.
      NODE-DISABLED = ' '.
      NODE-ISFOLDER = 'X'.
      CLEAR NODE-N_IMAGE.
      CLEAR NODE-EXP_IMAGE.
      NODE-EXPANDER = ' '. " The node is marked with a '+', although
                           " it has no children. When the user clicks on the
                           " + to open the node, the event
                           " expand_no_children is fired. The programmer can
                           " add the children of the
                           " node within the event handler of the
                           " expand_no_children event
                           " (see method handle_expand_no_children
                           " of class lcl_application)
      NODE-TEXT = WA_SFLIGHT-CONNID.
      APPEND NODE TO NODE_TABLE.
    ENDAT.
      Node with key 'Child3'
      NODE-NODE_KEY = WA_SFLIGHT-FLDATE. "#EC NOTEXT
                                " Key of the node
      " Node is inserted as child of the node with key 'Root'.
      NODE-RELATKEY = WA_SFLIGHT-CONNID.
      NODE-RELATSHIP = CL_GUI_SIMPLE_TREE=>RELAT_LAST_CHILD.
      NODE-HIDDEN = ' '.
      NODE-DISABLED = ' '.
      NODE-ISFOLDER = ' '.
      CLEAR NODE-N_IMAGE.
      CLEAR NODE-EXP_IMAGE.
      NODE-EXPANDER = ' '. " The node is marked with a '+', although
                           " it has no children. When the user clicks on the
                           " + to open the node, the event
                           " expand_no_children is fired. The programmer can
                           " add the children of the
                           " node within the event handler of the
                           " expand_no_children event
                           " (see method handle_expand_no_children
                           " of class lcl_application)
      NODE-TEXT = WA_SFLIGHT-FLDATE.
      APPEND NODE TO NODE_TABLE.
    ENDLOOP.
    Message was edited by:
            Madhu Shankar Nair

  • How to add a scrollbar to applet

    This is the source code of my applet.I wat to have an autoscroll on this applet
    i think it is usefull if i put here all the code for my project.
    ======================================================
    Class ConsolePanel:
    The file defines a class ConsolePanel. Objects of type
    ConsolePanel can be used for simple input/output exchanges with
    the user. Various routines are provided for reading and writing
    values of various types from the output. (This class gives all
    the I/O behavior of another class, Console, that represents a
    separate window for doing console-style I/O.)
    This class is dependent on another class, ConsoleCanvas.
    Note that when the console has the input focus, it is outlined with
    a bright blue border. If, in addition, the console is waiting for
    user input, then there will be a blinking cursor. If the console
    is not outlined in light blue, the user has to click on it before
    any input will be accepted.
    This is an update an earlier version of the same class,
    rewritten to use realToString() for output of floating point
    numbers..
    package myproj;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.JScrollPane;
    import javax.swing.JScrollBar;
    import javax.swing.*;
    public class ConsolePanel extends JTextArea{
    static public JScrollPane scrollPane;
    // ***************************** Constructors *******************************
    public ConsolePanel() { // default constructor just provides default window title and size
    setBackground(Color.white);
    setLayout(new BorderLayout(0, 0));
    canvas = new ConsoleCanvas(500,1000);
    scrollPane = new JScrollPane(canvas);
    scrollPane.setVerticalScrollBarPolicy(
    JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    scrollPane.setPreferredSize( new Dimension( 1000,10000) );
    add("Center", scrollPane);
    //scrollPane.getVerticalScrollBar().setUnitIncrement(1);
    try {
    jbInit();
    } catch (Exception ex) {
    ex.printStackTrace();
    public void clear() { // clear all characters from the canvas
    canvas.clear();
    // *************************** I/O Methods *********************************
    // Methods for writing the primitive types, plus type String,
    // to the console window, with no extra spaces.
    // Note that the real-number data types, float
    // and double, a rounded version is output that will
    // use at most 10 or 11 characters. If you want to
    // output a real number with full accuracy, use
    // "con.put(String.valueOf(x))", for example.
    public void put(int x) {
    put(x, 0);
    } // Note: also handles byte and short!
    public void put(long x) {
    put(x, 0);
    public void put(double x) {
    put(x, 0);
    } // Also handles float.
    public void put(char x) {
    put(x, 0);
    public void put(boolean x) {
    put(x, 0);
    public void put(String x) {
    put(x, 0);
    // Methods for writing the primitive types, plus type String,
    // to the console window,followed by a carriage return, with
    // no extra spaces.
    public void putln(int x) {
    put(x, 0);
    newLine();
    } // Note: also handles byte and short!
    public void putln(long x) {
    put(x, 0);
    newLine();
    public void putln(double x) {
    put(x, 0);
    newLine();
    } // Also handles float.
    public void putln(char x) {
    put(x, 0);
    newLine();
    public void putln(boolean x) {
    put(x, 0);
    newLine();
    public void putln(String x) {
    put(x, 0);
    newLine();
    // Methods for writing the primitive types, plus type String,
    // to the console window, with a minimum field width of w,
    // and followed by a carriage return.
    // If outut value is less than w characters, it is padded
    // with extra spaces in front of the value.
    public void putln(int x, int w) {
    put(x, w);
    newLine();
    } // Note: also handles byte and short!
    public void putln(long x, int w) {
    put(x, w);
    newLine();
    public void putln(double x, int w) {
    put(x, w);
    newLine();
    } // Also handles float.
    public void putln(char x, int w) {
    put(x, w);
    newLine();
    public void putln(boolean x, int w) {
    put(x, w);
    newLine();
    public void putln(String x, int w) {
    put(x, w);
    newLine();
    // Method for outputting a carriage return
    public void putln() {
    newLine();
    // Methods for writing the primitive types, plus type String,
    // to the console window, with minimum field width w.
    public void put(int x, int w) {
    dumpString(String.valueOf(x), w);
    } // Note: also handles byte and short!
    public void put(long x, int w) {
    dumpString(String.valueOf(x), w);
    public void put(double x, int w) {
    dumpString(realToString(x), w);
    } // Also handles float.
    public void put(char x, int w) {
    dumpString(String.valueOf(x), w);
    public void put(boolean x, int w) {
    dumpString(String.valueOf(x), w);
    public void put(String x, int w) {
    dumpString(x, w);
    // Methods for reading in the primitive types, plus "words" and "lines".
    // The "getln..." methods discard any extra input, up to and including
    // the next carriage return.
    // A "word" read by getlnWord() is any sequence of non-blank characters.
    // A "line" read by getlnString() or getln() is everything up to next CR;
    // the carriage return is not part of the returned value, but it is
    // read and discarded.
    // Note that all input methods except getAnyChar(), peek(), the ones for lines
    // skip past any blanks and carriage returns to find a non-blank value.
    // getln() can return an empty string; getChar() and getlnChar() can
    // return a space or a linefeed ('\n') character.
    // peek() allows you to look at the next character in input, without
    // removing it from the input stream. (Note that using this
    // routine might force the user to enter a line, in order to
    // check what the next character.)
    // Acceptable boolean values are the "words": true, false, t, f, yes,
    // no, y, n, 0, or 1; uppercase letters are OK.
    // None of these can produce an error; if an error is found in input,
    // the user is forced to re-enter.
    // Available input routines are:
    // getByte() getlnByte() getShort() getlnShort()
    // getInt() getlnInt() getLong() getlnLong()
    // getFloat() getlnFloat() getDouble() getlnDouble()
    // getChar() getlnChar() peek() getAnyChar()
    // getWord() getlnWord() getln() getString() getlnString()
    // (getlnString is the same as getln and is onlyprovided for consistency.)
    public byte getlnByte() {
    byte x = getByte();
    emptyBuffer();
    return x;
    public short getlnShort() {
    short x = getShort();
    emptyBuffer();
    return x;
    public int getlnInt() {
    int x = getInt();
    emptyBuffer();
    return x;
    public long getlnLong() {
    long x = getLong();
    emptyBuffer();
    return x;
    public float getlnFloat() {
    float x = getFloat();
    emptyBuffer();
    return x;
    public double getlnDouble() {
    double x = getDouble();
    emptyBuffer();
    return x;
    public char getlnChar() {
    char x = getChar();
    emptyBuffer();
    return x;
    public boolean getlnBoolean() {
    boolean x = getBoolean();
    emptyBuffer();
    return x;
    public String getlnWord() {
    String x = getWord();
    emptyBuffer();
    return x;
    public String getlnString() {
    return getln();
    } // same as getln()
    public String getln() {
    StringBuffer s = new StringBuffer(100);
    char ch = readChar();
    while (ch != '\n') {
    s.append(ch);
    ch = readChar();
    return s.toString();
    public byte getByte() {
    return (byte) readInteger( -128L, 127L);
    public short getShort() {
    return (short) readInteger( -32768L, 32767L);
    public int getInt() {
    return (int) readInteger((long) Integer.MIN_VALUE,
    (long) Integer.MAX_VALUE);
    public long getLong() {
    return readInteger(Long.MIN_VALUE, Long.MAX_VALUE);
    public char getAnyChar() {
    return readChar();
    public char peek() {
    return lookChar();
    public char getChar() { // skip spaces & cr's, then return next char
    char ch = lookChar();
    while (ch == ' ' || ch == '\n') {
    readChar();
    if (ch == '\n') {
    dumpString("? ", 0);
    ch = lookChar();
    return readChar();
    public float getFloat() { // can return positive or negative infinity
    float x = 0.0F;
    while (true) {
    String str = readRealString();
    if (str.equals("")) {
    errorMessage("Illegal floating point input.",
    "Real number in the range " + Float.MIN_VALUE +
    " to " + Float.MAX_VALUE);
    } else {
    Float f = null;
    try {
    f = Float.valueOf(str);
    } catch (NumberFormatException e) {
    errorMessage("Illegal floating point input.",
    "Real number in the range " + Float.MIN_VALUE +
    " to " + Float.MAX_VALUE);
    continue;
    if (f.isInfinite()) {
    errorMessage("Floating point input outside of legal range.",
    "Real number in the range " + Float.MIN_VALUE +
    " to " + Float.MAX_VALUE);
    continue;
    x = f.floatValue();
    break;
    return x;
    public double getDouble() {
    double x = 0.0;
    while (true) {
    String str = readRealString();
    if (str.equals("")) {
    errorMessage("Illegal floating point input",
    "Real number in the range " + Double.MIN_VALUE +
    " to " + Double.MAX_VALUE);
    } else {
    Double f = null;
    try {
    f = Double.valueOf(str);
    } catch (NumberFormatException e) {
    errorMessage("Illegal floating point input",
    "Real number in the range " + Double.MIN_VALUE +
    " to " + Double.MAX_VALUE);
    continue;
    if (f.isInfinite()) {
    errorMessage("Floating point input outside of legal range.",
    "Real number in the range " + Double.MIN_VALUE +
    " to " + Double.MAX_VALUE);
    continue;
    x = f.doubleValue();
    break;
    return x;
    public String getWord() {
    char ch = lookChar();
    while (ch == ' ' || ch == '\n') {
    readChar();
    if (ch == '\n') {
    dumpString("? ", 0);
    ch = lookChar();
    StringBuffer str = new StringBuffer(50);
    while (ch != ' ' && ch != '\n') {
    str.append(readChar());
    ch = lookChar();
    return str.toString();
    public boolean getBoolean() {
    boolean ans = false;
    while (true) {
    String s = getWord();
    if (s.equalsIgnoreCase("true") || s.equalsIgnoreCase("t") ||
    s.equalsIgnoreCase("yes") || s.equalsIgnoreCase("y") ||
    s.equals("1")) {
    ans = true;
    break;
    } else if (s.equalsIgnoreCase("false") || s.equalsIgnoreCase("f") ||
    s.equalsIgnoreCase("no") || s.equalsIgnoreCase("n") ||
    s.equals("0")) {
    ans = false;
    break;
    } else {
    errorMessage("Illegal boolean input value.",
    "one of: true, false, t, f, yes, no, y, n, 0, or 1");
    return ans;
    // ***************** Everything beyond this point is private *******************
    // ********************** Utility routines for input/output ********************
    private ConsoleCanvas canvas; // the canvas where I/O is displayed
    private String buffer = null; // one line read from input
    private int pos = 0; // position next char in input line that has
    // not yet been processed
    private String readRealString() { // read chars from input following syntax of real numbers
    StringBuffer s = new StringBuffer(50);
    char ch = lookChar();
    while (ch == ' ' || ch == '\n') {
    readChar();
    if (ch == '\n') {
    dumpString("? ", 0);
    ch = lookChar();
    if (ch == '-' || ch == '+') {
    s.append(readChar());
    ch = lookChar();
    while (ch == ' ') {
    readChar();
    ch = lookChar();
    } while (ch >= '0' && ch <= '9') {
    s.append(readChar());
    ch = lookChar();
    if (ch == '.') {
    s.append(readChar());
    ch = lookChar();
    while (ch >= '0' && ch <= '9') {
    s.append(readChar());
    ch = lookChar();
    if (ch == 'E' || ch == 'e') {
    s.append(readChar());
    ch = lookChar();
    if (ch == '-' || ch == '+') {
    s.append(readChar());
    ch = lookChar();
    } while (ch >= '0' && ch <= '9') {
    s.append(readChar());
    ch = lookChar();
    return s.toString();
    private long readInteger(long min, long max) { // read long integer, limited to specified range
    long x = 0;
    while (true) {
    StringBuffer s = new StringBuffer(34);
    char ch = lookChar();
    while (ch == ' ' || ch == '\n') {
    readChar();
    if (ch == '\n') {
    dumpString("? ", 0);
    ch = lookChar();
    if (ch == '-' || ch == '+') {
    s.append(readChar());
    ch = lookChar();
    while (ch == ' ') {
    readChar();
    ch = lookChar();
    } while (ch >= '0' && ch <= '9') {
    s.append(readChar());
    ch = lookChar();
    if (s.equals("")) {
    errorMessage("Illegal integer input.",
    "Integer in the range " + min + " to " + max);
    } else {
    String str = s.toString();
    try {
    x = Long.parseLong(str);
    } catch (NumberFormatException e) {
    errorMessage("Illegal integer input.",
    "Integer in the range " + min + " to " + max);
    continue;
    if (x < min || x > max) {
    errorMessage("Integer input outside of legal range.",
    "Integer in the range " + min + " to " + max);
    continue;
    break;
    return x;
    private static String realToString(double x) {
    // Goal is to get a reasonable representation of x in at most
    // 10 characters, or 11 characters if x is negative.
    if (Double.isNaN(x)) {
    return "undefined";
    if (Double.isInfinite(x)) {
    if (x < 0) {
    return "-INF";
    } else {
    return "INF";
    if (Math.abs(x) <= 5000000000.0 && Math.rint(x) == x) {
    return String.valueOf((long) x);
    String s = String.valueOf(x);
    if (s.length() <= 10) {
    return s;
    boolean neg = false;
    if (x < 0) {
    neg = true;
    x = -x;
    s = String.valueOf(x);
    if (x >= 0.00005 && x <= 50000000 &&
    (s.indexOf('E') == -1 && s.indexOf('e') == -1)) { // trim x to 10 chars max
    s = round(s, 10);
    s = trimZeros(s);
    } else if (x > 1) { // construct exponential form with positive exponent
    long power = (long) Math.floor(Math.log(x) / Math.log(10));
    String exp = "E" + power;
    int numlength = 10 - exp.length();
    x = x / Math.pow(10, power);
    s = String.valueOf(x);
    s = round(s, numlength);
    s = trimZeros(s);
    s += exp;
    } else { // constuct exponential form
    long power = (long) Math.ceil( -Math.log(x) / Math.log(10));
    String exp = "E-" + power;
    int numlength = 10 - exp.length();
    x = x * Math.pow(10, power);
    s = String.valueOf(x);
    s = round(s, numlength);
    s = trimZeros(s);
    s += exp;
    if (neg) {
    return "-" + s;
    } else {
    return s;
    private static String trimZeros(String num) { // used by realToString
    if (num.indexOf('.') >= 0 && num.charAt(num.length() - 1) == '0') {
    int i = num.length() - 1;
    while (num.charAt(i) == '0') {
    i--;
    if (num.charAt(i) == '.') {
    num = num.substring(0, i);
    } else {
    num = num.substring(0, i + 1);
    return num;
    private static String round(String num, int length) { // used by realToString
    if (num.indexOf('.') < 0) {
    return num;
    if (num.length() <= length) {
    return num;
    if (num.charAt(length) >= '5' && num.charAt(length) != '.') {
    char[] temp = new char[length + 1];
    int ct = length;
    boolean rounding = true;
    for (int i = length - 1; i >= 0; i--) {
    temp[ct] = num.charAt(i);
    if (rounding && temp[ct] != '.') {
    if (temp[ct] < '9') {
    temp[ct]++;
    rounding = false;
    } else {
    temp[ct] = '0';
    ct--;
    if (rounding) {
    temp[ct] = '1';
    ct--;
    // ct is -1 or 0
    return new String(temp, ct + 1, length - ct);
    } else {
    return num.substring(0, length);
    private void dumpString(String str, int w) { // output string to console
    for (int i = str.length(); i < w; i++) {
    canvas.addChar(' ');
    for (int i = 0; i < str.length(); i++) {
    if ((int) str.charAt(i) >= 0x20 && (int) str.charAt(i) != 0x7F) { // no control chars or delete
    canvas.addChar(str.charAt(i));
    } else if (str.charAt(i) == '\n' || str.charAt(i) == '\r') {
    newLine();
    private void errorMessage(String message, String expecting) {
    // inform user of error and force user to re-enter.
    newLine();
    dumpString(" *** Error in input: " + message + "\n", 0);
    dumpString(" *** Expecting: " + expecting + "\n", 0);
    dumpString(" *** Discarding Input: ", 0);
    if (lookChar() == '\n') {
    dumpString("(end-of-line)\n\n", 0);
    } else {
    while (lookChar() != '\n') {
    canvas.addChar(readChar());
    dumpString("\n\n", 0);
    dumpString("Please re-enter: ", 0);
    readChar(); // discard the end-of-line character
    private char lookChar() { // return next character from input
    if (buffer == null || pos > buffer.length()) {
    fillBuffer();
    if (pos == buffer.length()) {
    return '\n';
    return buffer.charAt(pos);
    private char readChar() { // return and discard next character from input
    char ch = lookChar();
    pos++;
    return ch;
    private void newLine() { // output a CR to console
    canvas.addCR();
    private void fillBuffer() { // Wait for user to type a line and press return,
    // and put the typed line into the buffer.
    buffer = canvas.readLine();
    pos = 0;
    private void emptyBuffer() { // discard the rest of the current line of input
    buffer = null;
    public void clearBuffers() { // I expect this will only be called by
    // CanvasApplet when a program ends. It should
    // not be called in the middle of a running program.
    buffer = null;
    canvas.clearTypeAhead();
    private void jbInit() throws Exception {
    this.setNextFocusableComponent(scrollPane);
    this.setToolTipText("");
    } // end of class Console
    ============================================================
    Class ConsoleCanvas:
    /* A class that implements basic console-oriented input/output, for use with
    Console.java and ConsolePanel.java. This class provides the basic character IO.
    Higher-leve fucntions (reading and writing numbers, booleans, etc) are provided
    in Console.java and ConolePanel.java.
    (This vesion of ConsoleCanvas is an udate of an earilier version, rewritten to
    be compliand with Java 1.1. David Eck; July 17, 1998.)
    (Modified August 16, 1998 to add the
    a mousePressed method to ConsoleCanvas. The mousePressed method requests
    the focus. This is necessary for Sun's Java implementation -- though not,
    apparently for anyone else's. Also added: an isFocusTraversable() method)
    MouseListener interface and
    Minor modifications, February 9, 2000, some glitches in the graphics.
    package myproj;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    public class ConsoleCanvas extends JTextArea implements FocusListener, KeyListener,
    MouseListener {
    // public interface, constructor and methods
    public ConsoleCanvas(int u,int y) {
    addFocusListener(this);
    addKeyListener(this);
    try {
    jbInit();
    } catch (Exception ex) {
    ex.printStackTrace();
    public final String readLine() { // wait for user to enter a line of input;
    // Line can only contain characters in the range
    // ' ' to '~'.
    return doReadLine();
    public final void addChar(char ch) { // output PRINTABLE character to console
    putChar(ch);
    public final void addCR() { // add a CR to the console
    putCR();
    public synchronized void clear() { // clear console and return cursor to row 0, column 0.
    if (OSC == null) {
    return;
    currentRow = 0;
    currentCol = 0;
    OSCGraphics.setColor(Color.white);
    OSCGraphics.fillRect(4, 4, getSize().width - 8, getSize().height - 8);
    OSCGraphics.setColor(Color.black);
    repaint();
    try {
    Thread.sleep(25);
    } catch (InterruptedException e) {}
    // focus and key event handlers; not meant to be called excpet by system
    public void keyPressed(KeyEvent evt) {
    doKey(evt.getKeyChar());
    public void keyReleased(KeyEvent evt) {}
    public void keyTyped(KeyEvent evt) {}
    public void focusGained(FocusEvent evt) {
    doFocus(true);
    public void focusLost(FocusEvent evt) {
    doFocus(false);
    public boolean isFocusTraversable() {
    // Allows the user to move the focus to the canvas
    // by pressing the tab key.
    return true;
    // Mouse listener methods -- here just to make sure that the canvas
    // gets the focuse when the user clicks on it. These are meant to
    // be called only by the system.
    public void mousePressed(MouseEvent evt) {
    requestFocus();
    public void mouseReleased(MouseEvent evt) {}
    public void mouseClicked(MouseEvent evt) {}
    public void mouseEntered(MouseEvent evt) {}
    public void mouseExited(MouseEvent evt) {}
    // implementation section: protected variables and methods.
    protected StringBuffer typeAhead = new StringBuffer();
    // Characters typed by user but not yet processed;
    // User can "type ahead" the charcters typed until
    // they are needed to satisfy a readLine.
    protected final int maxLineLength = 256;
    // No lines longer than this are returned by readLine();
    // The system effectively inserts a CR after 256 chars
    // of input without a carriage return.
    protected int rows, columns; // rows and columns of chars in the console
    protected int currentRow, currentCol; // current curson position
    protected Font font; // Font used in console (Courier); All font
    // data is set up in the doSetup() method.
    protected int lineHeight; // height of one line of text in the console
    protected int baseOffset; // distance from top of a line to its baseline
    protected int charWidth; // width of a character (constant, since a monospaced font is used)
    protected int leading; // space between lines
    protected int topOffset; // distance from top of console to top of text
    protected int leftOffset; // distance from left of console to first char on line
    protected Image OSC; // off-screen backup for console display (except cursor)
    protected Graphics OSCGraphics; // graphics context for OSC
    protected boolean hasFocus = false; // true if this canvas has the input focus
    protected boolean cursorIsVisible = false; // true if cursor is currently visible
    private int pos = 0; // exists only for sharing by next two methods
    public synchronized void clearTypeAhead() {
    // clears any unprocessed user typing. This is meant only to
    // be called by ConsolePanel, when a program being run by
    // console Applet ends. But just to play it safe, pos is
    // set to -1 as a signal to doReadLine that it should return.
    typeAhead.setLength(0);
    pos = -1;
    notify();
    protected synchronized String doReadLine() { // reads a line of input, up to next CR
    if (OSC == null) { // If this routine is called before the console has
    // completely opened, we shouldn't procede; give the
    // window a chance to open, so that paint() can call doSetup().
    try {
    wait(5000);
    } catch (InterruptedException e) {} // notify() should be set by doSetup()
    if (OSC == null) { // If nothing has happened for 5 seconds, we are probably in
    // trouble, but when the heck, try calling doSetup and proceding anyway.
    doSetup();
    if (!hasFocus) { // Make sure canvas has input focus
    requestFocus();
    StringBuffer lineBuffer = new StringBuffer(); // buffer for constructing line from user
    pos = 0;
    while (true) { // Read and process chars from the typeAhead buffer until a CR is found.
    while (pos >= typeAhead.length()) { // If the typeAhead buffer is empty, wait for user to type something
    cursorBlink();
    try {
    wait(500);
    } catch (InterruptedException e) {}
    if (pos == -1) { // means clearTypeAhead was called;
    return ""; // this is an abnormal return that should not happen
    if (cursorIsVisible) {
    cursorBlink();
    if (typeAhead.charAt(pos) == '\r' || typeAhead.charAt(pos) == '\n') {
    putCR();
    pos++;
    break;
    if (typeAhead.charAt(pos) == 8 || typeAhead.charAt(pos) == 127) {
    if (lineBuffer.length() > 0) {
    lineBuffer.setLength(lineBuffer.length() - 1);
    eraseChar();
    pos++;
    } else if (typeAhead.charAt(pos) >= ' ' &&
    typeAhead.charAt(pos) < 127) {
    putChar(typeAhead.charAt(pos));
    lineBuffer.append(typeAhead.charAt(pos));
    pos++;
    } else {
    pos++;
    if (lineBuffer.length() == maxLineLength) {
    putCR();
    pos = typeAhead.length();
    break;
    if (pos >= typeAhead.length()) { // delete all processed chars from typeAhead
    typeAhead.setLength(0);
    } else {
    int len = typeAhead.length();
    for (int i = pos; i < len; i++) {
    typeAhead.setCharAt(i - pos, typeAhead.charAt(i));
    typeAhead.setLength(len - pos);
    return lineBuffer.toString(); // return the string that was entered
    protected synchronized void doKey(char ch) { // process key pressed by user
    typeAhead.append(ch);
    notify();
    private void putCursor(Graphics g) { // draw the cursor
    g.drawLine(leftOffset + currentCol * charWidth + 1,
    topOffset + (currentRow * lineHeight),
    leftOffset + currentCol * charWidth + 1,
    topOffset + (currentRow * lineHeight + baseOffset));
    protected synchronized void putChar(char ch) { // draw ch at cursor position and move cursor
    if (OSC == null) { // If this routine is called before the console has
    // completely opened, we shouldn't procede; give the
    // window a chance to open, so that paint() can call doSetup().
    try {
    wait(5000);
    } catch (InterruptedException e) {} // notify() should be set by doSetup()
    if (OSC == null) { // If nothing has happened for 5 seconds, we are probably in
    // trouble, but when the heck, try calling doSetup and proceding anyway.
    doSetup();
    if (currentCol >= columns) {
    putCR();
    currentCol++;
    Graphics g = getGraphics();
    g.setColor(Color.black);
    g.setFont(font);
    char[] fudge = new char[1];
    fudge[0] = ch;
    g.drawChars(fudge, 0, 1, leftOffset + (currentCol - 1) * charWidth,
    topOffset + currentRow * lineHeight + baseOffset);
    g.dispose();
    OSCGraphics.drawChars(fudge, 0, 1,
    leftOffset + (currentCol - 1) * charWidth,
    topOffset + currentRow * lineHeight + baseOffset);
    protected void eraseChar() { // erase char before cursor position and move cursor
    if (currentCol == 0 && currentRow == 0) {
    return;
    currentCol--;
    if (currentCol < 0) {
    currentRow--;
    currentCol = columns - 1;
    Graphics g = getGraphics();
    g.setColor(Color.white);
    g.fillRect(leftOffset + (currentCol * charWidth),
    topOffset + (currentRow * lineHeight),
    charWidth, lineHeight - 1);
    g.dispose();
    OSCGraphics.setColor(Color.white);
    OSCGraphics.fillRect(leftOffset + (currentCol * charWidth),
    topOffset + (currentRow * lineHeight),
    charWidth, lineHeight - 1);
    OSCGraphics.setColor(Color.black);
    protected synchronized void putCR() { // move cursor to start of next line, scrolling window if necessary
    if (OSC == null) { // If this routine is called before the console has
    // completely opened, we shouldn't procede; give the
    // window a chance to open, so that paint() can call doSetup().
    try {
    wait(5000);
    } catch (InterruptedException e) {} // notify() should be set by doSetup()
    if (OSC == null) { // If nothing has happened for 5 seconds, we are probably in
    // trouble, but when the heck, try calling doSetup and proceding anyway.
    doSetup();
    currentCol = 0;
    currentRow++;
    if (currentRow < rows) {
    return;
    OSCGraphics.copyArea(leftOffset, topOffset + lineHeight,
    columns * charWidth,
    (rows - 1) * lineHeight - leading, 0, -lineHeight);
    OSCGraphics.setColor(Color.white);
    OSCGraphics.fillRect(leftOffset, topOffset + (rows - 1) * lineHeight,
    columns * charWidth, lineHeight - leading);
    OSCGraphics.setColor(Color.black);
    currentRow = rows - 1;
    Graphics g = getGraphics();
    paint(g);
    g.dispose();
    try {
    Thread.sleep(20);
    } catch (InterruptedException e) {}
    protected void cursorBlink() { // toggle visibility of cursor (but don't show it if focus has been lost)
    if (cursorIsVisible) {
    Graphics g = getGraphics();
    g.setColor(Color.white);
    putCursor(g);
    cursorIsVisible = false;
    g.dispose();
    } else if (hasFocus) {
    Graphics g = getGraphics();
    g.setColor(Color.black);
    putCursor(g);
    cursorIsVisible = true;
    g.dispose();
    protected synchronized void doFocus(boolean focus) { // react to gain or loss of focus
    if (OSC == null) {
    doSetup();
    hasFocus = focus;
    if (hasFocus) { // the rest of the routine draws or erases border around canvas
    OSCGraphics.setColor(Color.cyan);
    } else {
    OSCGraphics.setColor(Color.white);
    int w = getSize().width;
    int h = getSize().height;
    for (int i = 0; i < 3; i++) {
    OSCGraphics.drawRect(i, i, w - 2 * i, h - 2 * i);
    OSCGraphics.drawLine(0, h - 3, w, h - 3);
    OSCGraphics.drawLine(w - 3, 0, w - 3, h);
    OSCGraphics.setColor(Color.black);
    repaint();
    try {
    Thread.sleep(50);
    } catch (InterruptedException e) {}
    notify();
    protected void doSetup() { // get font parameters and create OSC
    int w = getSize().width;
    int h = getSize().height;
    font = new Font("Courier", Font.PLAIN, getFont().getSize());
    FontMetrics fm = getFontMetrics(font);
    lineHeight = fm.getHeight();
    leading = fm.getLeading();
    baseOffset = fm.getAscent();
    charWidth = fm.charWidth('W');
    columns = (w - 12) / charWidth;
    rows = (h - 12 + leading) / lineHeight;
    leftOffset = (w - columns * charWidth) / 2;
    topOffset = (h + leading - rows * lineHeight) / 2;
    OSC = createImage(w, h);
    OSCGraphics = OSC.getGraphics();
    OSCGraphics.setFont(font);
    OSCGraphics.setColor(Color.white);
    OSCGraphics.fillRect(0, 0, w, h);
    OSCGraphics.setColor(Color.black);
    notify();
    public void update(Graphics g) {
    paint(g);
    public synchronized void paint(Graphics g) {
    if (OSC == null) {
    doSetup();
    g.drawImage(OSC, 0, 0, this);
    private void jbInit() throws Exception {
    ===============================================================
    and finally Consola:
    package myproj;
    /* The Consola provides a basis for writing applets that simulate
    line-oriented consola-type input/output. The class ConsoleCanvas is
    used to provide the I/O routines; these routines type output into
    the ConsoleCanvas and read input typed there by the user. See the
    files CanvasPanel.java and ConsoleCanvas.java for information.
    A consola applet is set up to run one particular program. The applet
    includes a button that the user presses to run the program (or to
    abort it when it is running). It also includes a label, which by default
    is "Java I/O consola". The default program, defined in this file,
    is a simple Hello World program.
    To write a new consola applet, with a more interesting program, you
    should create a subclass of Consola. The subclass should
    override the method program() , which represents the program to
    be run. The program should use the instance variable, consola, to
    do input/output. For example, consola.putln("HelloWorld.")
    or N=consola.getInt(). All the public methods of class ConsolePanel
    can be called in the program.
    (Of course, you could also just modify this file, instead of
    writing a subclass.)
    import java.awt.*;
    import java.awt.event.*;
    import myproj.ConsoleCanvas;
    import myproj.ConsolePanel;
    import java.util.*;
    import javax.swing.JScrollPane;
    import javax.swing.JList;
    import javax.swing.*;
    import java.io.*;
    public class Consola extends java.applet.Applet implements Runnable,
    ActionListener {
    public Consola() {
    try {
    jbInit();
    } catch (Exception ex) {
    ex.printStackTrace();
    protected String title = "Configure Vlan "; // (Used for compatibility with previous versions of consola Applet)
    protected String getTitle() {
    // Return a label to appears over the consola;
    // If you want to change the label, override this
    // method to return a different string.
    return title;
    //variabilele mele
    static String[] Foo={"Fa0/1","Fa0/2","Fa0/3","Fa0/4","Fa0/5","Fa0/6","Fa0/7","Fa0/8","Fa0/9","F a0/10","Fa0/11","Fa0/12"};
    static String[] vlan={"","","","","","","","","","","",""};
    static String [] showdefault={"","","","","","","","","","","",""};
    stat

    First thing...you made a mistake
    import javax.swing.JScrollPane;
    import javax.swing.JScrollBar;
    import javax.swing.*;When you import javax.swing.*; You automatically
    import JScrollPane & JScrollBar class, there's no
    need for you to re import again...
    That is not always a mistake. There are cases where it makes sense to do both (i.e., to import both '*' and a specific class name from that package at the same time). I believe the common example is:
    import java.awt.*;
    import java.util.*;
    import java.util.List;Now you can use "List" as a short name for "java.util.List", but must use "java.awt.List" in full for "java.awt.List" objects. If you just did:
    import java.awt.*;
    import java.util.*;Then you couldn't use List as a short name for anything--because it is ambiguous. You'd have to use both "java.awt.List" and "java.util.List" spelled out in full.
    Or, if you did:
    import java.awt.*;
    import java.util.*;
    import java.awt.List; // NOTE CHANGEThen "List" is short for "java.awt.List", and you must use "java.util.List" in full for "java.awt.List" objects.

  • How to add new criteria in simple search region ?

    Hi,
    I have been trying to add a new criteria for simple search in a seeded oaf page and facing some issue. I have successfully created the criteria field but unable to filter the search using the new criteria item. Kindly help so that i can proceed.
    Thanks,

    Hi,
    I have been trying to add a new criteria for simple search in a seeded oaf page and facing some issue. I have successfully created the criteria field but unable to filter the search using the new criteria item. Kindly help so that i can proceed.
    Thanks,

  • How to add a list bean in seeded region?

    Hi All,
    I am working on "employee self service" responsibility addcompetency page.on which I have a requirement to add a list bean. Fro that I have extended CO and added folowing code in that co.
    super.processRequest(pageContext, webBean);
    OADefaultListBean list =
    (OADefaultListBean)createWebBean(pageContext, OAWebBeanConstants.DEFAULT_LIST_BEAN,
    null, "popuplist");
    list.setListViewObjectDefinitionName("oracle.apps.per.selfservice.competency.profile.server.CompSearchVO");
    list.setListValueAttribute("compType");
    list.setListDisplayAttribute("compType");
    list.setMultiple(true);
    list.setName("poplist");
    OAMessageComponentLayoutBean listboxlayout =
    (OAMessageComponentLayoutBean)webBean.findChildRecursive("searchFiltersRN");
    pageContext.putDialogMessage(new OAException("Hello" + listboxlayout));
    But It is returning null in Dialogue message.The Id is Also right.
    Please Help.
    Regards,
    SHD

    Hi,
    Try this :
    super.processRequest(pageContext, webBean);
    OADefaultListBean list =
    (OADefaultListBean)createWebBean(pageContext, OAWebBeanConstants.DEFAULT_LIST_BEAN,
    null, "popuplist");
    list.setListViewObjectDefinitionName("oracle.apps.per.selfservice.competency.profile.server.CompSearchVO");
    list.setListValueAttribute("compType");
    list.setListDisplayAttribute("compType");
    list.setMultiple(true);
    list.setName("poplist");
    OAMessageComponentLayoutBean listboxlayout = (OAMessageComponentLayoutBean)webBean.findIndexedChildRecursive("searchFiltersRN");
    if(listboxlayout!=null)
    listboxlayout.addIndexedChild(list);
    Check for the correct id of the OAMessageComponentLayoutBean as this is the correct code to add the list bean.
    Thanks,
    Gaurav

  • How to add a report to HR Report tree

    Hello Friends,
                         I need to add a report to HR Report tree.
    Guide me how to do it.
    Cheers
    Senthil

    Use transaction SE43 and SE43N.
    Check this threads
    How to add a report into the tree??
    Adding report/program to Report Tree
    Manoj.

  • How to add scrollbar to jpopup menu

    Hi everyone,
    Do u know how to add a scrollbar to jpopup menu ?

    Menus don't scroll, and shouldn't scroll. Given that, you shouldn't try and use JPopupMenu at all... rather, create your own component that implements the look and behavior you want. It will be far easier and less frustrating.
    Either that... or you should re-think what functionality you are trying to provide, and how you are trying to implement it. A scrolling menu just seems like a counterintuitive wacky UI design to me.

Maybe you are looking for

  • Public int move(CDRack anotherRack)

    I have problems with method: move(CDRack anotherRack). It removes CDs from anotherRack, but the rack I'm trying to fill in with anotherRack's CDs is filled with a one same CD from the anotherRack not various CDs as it should.. hard to explain.:) Is s

  • No audio after ICS update.

    After ICS update, have lost audio playback. In settings, speaker has single line crossing thru it showing audio is muted. Can not unmute audio. Same for audio 'alerts'. Have rebooted and pulled battery to no avail. Ideas?

  • Airport Express with a Buffalo LinkStation Pro

    Hi Im thinking of purchasing a Buffalo LinkStation Pro networked drive to hook up to my home network. http://www.buffalotech.com/products/network-storage/home-and-small-office/linkst ation-pro-ls-xhl/ One of the specifications of this drive is that i

  • No print preview

    Office Jet 5742 has no print preview option. Anyway to attain this option?

  • Lock object vith forgien key

    HI All, I have 4 table that are related via forgin key ,i want to create lock object and my question is if i need to create lock object for each table or just one lock object. Best Regards Joy