How i can show the user input in alv list on the top

hi all,
               please tell me how i can show the user input in alv list on the top.
                     and  also tell me how i  can hide the toolbar in alv.
regards
vikas saini

Hi,
Use the Below Code.
form top_of_page.                                          
  data : it_header type slis_t_listheader,
         is_header type slis_listheader.
  is_header-typ  = c_h.
  is_header-key  = space.
  is_header-info = 'Pending Order Information Report'(018).
  append is_header to it_header.
  call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
      it_list_commentary = it_header.
endform.                    "top_of_page
and finally pass it to .
call function 'REUSE_ALV_GRID_DISPLAY'
      exporting
        i_callback_program     = sy-repid
        i_callback_top_of_page = 'TOP_OF_PAGE'
call function 'REUSE_ALV_GRID_DISPLAY'
      exporting
        i_callback_program     = sy-repid
        i_callback_top_of_page = 'TOP_OF_PAGE'
Regards.
Arbind

Similar Messages

  • How would I change the variables in multiple methods with the user input?

    Here is my code for a tic tac toe game I have to do for an assignment, it is currently set at the normal 3 x 3, but the teacher what the user to be albe to change these to between 3-5 before they start playing, here is my codeing
    import java.util.*;
    public class TicTacToe
    Constructs an empty board.
    private String[][] board;
    private static int ROWS = 3;
    private static int COLUMNS = 3;
    public TicTacToe()
    int size = in.nextInt();
    board = new String[ROWS][COLUMNS];
    // Fill with spaces
    for (int i = 0; i < size; i++)
    for (int j = 0; j < size; j++)
    board[i][j] = " ";
    Sets a field in the board. The field must be unoccupied.
    @param i the row index
    @param j the column index
    @param player the player ("x" or "o")
    public void set(int i, int j, String player)
    if (board[i][j].equals(" "))
    board[i][j] = player;
    Creates a string representation of the board, such as
    |x o|
    | x |
    | o|
    @return the string representation
    public String toString()
    String r = "";
    for (int i = 0; i < ROWS; i++)
    r = r + "|";
    for (int j = 0; j < COLUMNS; j++)
    r = r + board[i][j];
    r = r + "|\n";
    return r;
    I am having a problem figuring out how to change the variables ROWS , COLUMNS to the given user input, it seems easy but i can't really figure out how to do it
    thanks ahead of time

    import java.util.*;
    public class TicTacToe
    Constructs an empty board.
    private String[][] board;
    private static int ROWS = 3;
    private static int COLUMNS = 3;
    public TicTacToe()
    int size = in.nextInt();
    board = new String[ROWS][COLUMNS];
    // Fill with spaces
    for (int i = 0; i < size; i++)
    for (int j = 0; j < size; j++)
    board[j] = " ";
    Sets a field in the board. The field must be unoccupied.
    @param i the row index
    @param j the column index
    @param player the player ("x" or "o")
    public void set(int i, int j, String player)
    if (board[j].equals(" "))
    board[j] = player;
    Creates a string representation of the board, such as
    |x o|
    | x |
    | o|
    @return the string representation
    public String toString()
    String r = "";
    for (int i = 0; i < ROWS; i++)
    r = r + "|";
    for (int j = 0; j < COLUMNS; j++)
    r = r + board[j];
    r = r + "|\n";
    return r;
    }sorry for not posting code correctyl new to this forums
    Thanks for the help but let me rephrase my question, the rows and columns are the same like 3x3, 4x4 ,or 5x5,
    -when the program runs it will ask the user for what they want to set the tic tac toe at between 3 - 5.
    My question is how do I get the code
    Scanner a = new Scanner ( System.in );
    System.out.print("Enter the size of the tic tac toe box to be between 3-5 : ");
    int sizeTicTacToe = a.next();to change the variables of ROWS COLUMNS
    I just want to know of a way to make the users input of sizeTicTacToe to change the variables ROWS & COLUMNS in my toString() and TicTacToe() methods

  • Add a actionlistener to JTextArea and print out string when  the user input

    Hello:
    I got a problem to add a actionlistener to JTextArea and print out string which from the user input a sentence and after the user press the "enter".
    Could anyone help me please?
    Thanks
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.JScrollBar;
    public class PanelDemo extends JFrame {
       private static JTextArea tAreaUp, tAreaDown;
       private BorderLayout layout;
       private static String strings;
       public PanelDemo()
          super( " test " );
          Container container = getContentPane();
          layout = new BorderLayout();
          container.setLayout( layout );
          tAreaUp = new JTextArea(2,1);
          tAreaUp.setLineWrap(true);
          tAreaUp.setWrapStyleWord(true);
          tAreaUp.setEditable(false);
          tAreaUp.append("I am testing ");
          tAreaUp.append("I am testing");
           JScrollPane scrollPane = new JScrollPane(tAreaUp);
           scrollPane.setVerticalScrollBarPolicy(
                            JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
           scrollPane.setPreferredSize(new Dimension(250, 250));
          tAreaDown =new JTextArea(2,1);
          tAreaDown.setLineWrap(true);
          tAreaDown.setWrapStyleWord(true);
          tAreaDown.addActionListener(new TextAreaHandler());
          JScrollPane scrollPane2 = new JScrollPane(tAreaDown);
          scrollPane2.setVerticalScrollBarPolicy(
                            JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
          container.add( scrollPane, layout.CENTER );
          container.add( scrollPane2, layout.SOUTH );
          setSize( 300, 300 );
          setVisible( true );
         //private inner class for event handling
         private class TextAreaHandler implements ActionListener{
              //process textArea events
            public void actionPerformed(ActionEvent e){
               strings=e.getActionCommand();
                System.out.println(strings);
       public static void main( String args[] )
          PanelDemo application = new PanelDemo();
          application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    }

    Thanks for your help, but I still got a question for you.
    Do you think the way I register the even handler to the TextArea is correct?
    Because the compailer complains about that which like
    "D:\101\fig13_27\PanelDemo.java:43: cannot resolve symbol
    symbol  : method addActionListener (PanelDemo.TextAreaHandler)
    location: class javax.swing.JTextArea
          tAreaDown.addActionListener(new TextAreaHandler());

  • Print parameters as per the user selection in ALV

    Hi All,
    We have a requriment for getting the print parametrs to print dialog as per the user selection in ALV list display.
    When the user click on 'Print' button In ALV list output screen, we need to capture the print parameters from a Z table and put those on the print parameters dialog box.
    I tried this , by calling the function GET_PRINT_PARAMETERS and SET_PRINT_PARAMETERS before the alv function is called. Unforutnately this is not working. Same code works for the simple list display.
    Have anyone worked with this kind of requriment ?
    Regards,
    Mithun

    What kind of ALV are you using, FM or OO?
    Regards,
    Rich Heilman

  • How i can show the selection screen input field in the top of page in alv

    hi ,
              how i can show the selection screen input field in the top of page in alv  grid output.
    tell me the process

    Hi,
    excample from my program:
    FORM topof_page.
      DATA: l_it_header   TYPE TABLE OF slis_listheader WITH HEADER LINE,
            l_info        LIKE l_it_header-info.
      DATA: l_it_textpool TYPE TABLE OF textpool WITH HEADER LINE.
      DATA: l_key LIKE l_it_textpool-key.
      READ TEXTPOOL c_repid INTO l_it_textpool LANGUAGE sy-langu.
      DEFINE m_selinfo.
        if not &1 is initial.
          clear l_it_header.
          l_it_header-typ   = 'S'.
          l_key = '&1'.
          translate l_key to upper case.
          read table l_it_textpool with key key = l_key.
          if sy-subrc = 0.
            shift l_it_textpool-entry left deleting leading space.
            l_it_header-key = l_it_textpool-entry  .
          endif.
          loop at &1.
            case &1-option.
              when 'EQ'
                or 'BT'
                or 'CP'.
                write &1-low to l_it_header-info.
              when others.
                write &1-low to l_it_header-info.
                concatenate &1-option
                            l_it_header-info
                       into l_it_header-info
                       separated by space.
            endcase.
            if not &1-high is initial.
              write &1-high to l_info left-justified.
              concatenate l_it_header-info
                          l_info
                     into l_it_header-info
                     separated by space.
            endif.
            if &1-sign = 'E'.
              concatenate ']'
                          l_it_header-info
                     into l_it_header-info.
            endif.
            append l_it_header.
            clear: l_it_header-key,
                   l_it_header-info.
          endloop.
        endif.
      END-OF-DEFINITION.
      m_selinfo: s_trmdat,
                 s_trmext,
                 s_trmint,
                 s_fkdat,
                 s_delno,
                 s_vbeln,
                 s_deact,
                 s_kdmat.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                it_list_commentary = l_it_header[].
    ENDFORM.
    I hope, this will help you.
    Regards
    Nicole

  • How can I have the user input two things to get result

    Hi
    I am trying to produce an interactive slide where the user will input two items and then receive the result.
    The easiest way to describe what I am hoping to do is..........
    Imagine the multipllication table and the user has to input what he wants to mulitiply ie 3 in the first text entry box and 5 in the next presses the button and the result is shown.
    Now imagine the table isn't a mathematical table but a series of words across the x and y axis. The user inputs Word A, Word B and presses submit and the answer (another word) depending on the two inputs appears. There would be 12 x12 table so 144 different combinations.
    Is this possible in Captivate 7?
    thanks
    Ruth

    HI
    There is little relationship between the two, this isn't actually the table but the same principle and shows what I am trying to acheive.
    cookies
    muffins
    cupcakes
    chicken roast
    crispies
    gas mark 1
    great idea
    gas mark 2
    great idea
    flapjacks
    gas mark 2
    gas mark 3
    350 C
    450F
    roast potatoes
    impossible
    great idea
    gas mark 3
    450F
    parsnips
    great idea
    350 C
    gas mark 3
    impossible
    thanks
    Ruth

  • How to capture the User input value to user exist function module.

    Hi,
    How can i capture user input value.Here i am using User exist in BPS variable.
    Calculating days using user exist functin module and my input is another variable i.e user defined value.
    How can i capture user defined vaule into my function module.
    This is very urgent can you help me..
    Thanks....

    Hi!
    You can get the instance using the method get_instance of the class cl_sem_variable, and call the method get_value with the return. Check the example:
          CALL METHOD cl_sem_variable=>get_instance
            EXPORTING
              i_area       = (planning area)
              i_variable   = (variable name)
            RECEIVING
              rr_variable  = lr_var
            EXCEPTIONS
              not_existing = 1
              OTHERS       = 2.
          CHECK sy-subrc IS INITIAL.
          CALL METHOD lr_var->get_value
            RECEIVING
              rto_value = et_value
            EXCEPTIONS
              error     = 1.
    After this, read the first line of the table et_value (it should be the value that the user choose on the screen).
    seeya!
    Robson

  • How to get the User input of Dynamic Action confirmation message ?

    Hi Guys,
    I'm using apex 4.1,
    I have added a confirmation message box as page Dynamic Action. How can i get the user input of that confirmation pop up ?
    Thanks

    Hi,
    you don't directly get the user input. But you should still be able to get what you want. Let's assume you have a dynamic action which fires for a "Change" (or any other) event and which has two or more actions
    1) Confirm
    2) Execute PL/SQL Code
    If the user clicks Cancel/No in the confirm dialog, APEX will stop the execution of this dynamic action and not run "Execute PL/SQL Code".
    Hope that helps
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • How to generate the User-Input XML Body for executing workflows via REST APIs: The Solution

    I see that executing a workflow via REST APIs requires lot of work to be done just to prepare the right User-input XML body. Any mistake and you have some major debugging to do. Larger the number of User-Inputs, the bigger is the problem.Life is so much easier at the WFA GUI with Display names and tooltip help for User Inputs which are very easy for reading and providing the right values. I don't have any such privileges when manually preparing the User-Input XML body.It’s been asked numerous times how to provide User-Input values for type table, or Query (Multi-Select) etc. These are complex User-Input types and has lots of scope for user mistakes.I can have User-input dependency at WFA GUI which allows me to make the right selection, but while preparing my XML body I need to take care of it myself.An operator is allowed to execute workflows, but the same Display names which help him make the right user-inputs, makes it impossible for him to prepare the user-input body xml. Display names can't be used in in XML body and he can't know the exact parameter names by looking at the Display names. So he need to always contact the Admins/Architects for this. And Architects/Admins can't be expected to keep providing User-Input XML body to operators every operator. How about if I could enter all the User-Input values in my workflow execution at WFA GUI, I can do a preview which passed to my satisfaction and then I can magically get the XML body for it which I can use to execute my workflow from REST APIs from any client. It could be so very much easy for me than building my User-Input XML body manually. This is exactly what I'm going to give you right now. You open the WFA in browser, Go to your workflow, Start execution, you input values from GUI reading carefully the display names, preview it to your satisfaction and then get the XML body. Assume your workflow is called “Workflow to Print a given Message”. It’s a simple workflow with only 1 user-input Displayed as "Message to Print" Prerequisites:  The following are the one-time prerequisites. You need PowerShell 3.0 on your WFA server.Import the attached Generate_Workflow_User_Input_Body_in_XML.dar in your WFA. It’s our magical command called "Generate Workflow User Input Body in XML"Add credentials of a WFA Admin/Architect in you WFA itself with Name/IP: localhostMatch: ExactType: OtherName/IP: localhostUsername: <WFA Admin/Architect Username>Password: <User Password>   Steps: Suppose you have a workflow called "Workflow to Print a given Message". You want to execute it from REST apis and need to prepare the user input XML body.  Select this workflow and clone it. The workflow clone is the exact copy of your original workflow word by word, input-by-input. It will open in Edit mode with name "Workflow to Print a given Message - copy".Add the command "Generate Workflow User Input Body in XML" at the beginning of your workflow. This is a must. This command need to be the first command in your cloned workflow.This command requires no input. So for its Parameters just press okay and save the workflow.You are done.Now Execute the clone workflow. You'll see all the user-inputs available to you. Make your choices as you wish. Preview it to confirm that planning is passed and u have no errors.Execute it now.You'll see that the our magical command "Generate Workflow User Input Body in XML" has failed in our clone workflow execution. Don't worry, its fate was decided to be so. But it didn't fail before giving me what I really wanted. i.e. my XML body for my real workflow. It displayed it in the GUI as well as saved it in your WFA server @ C:\temp\<workflow_name_dd_MM_yyyy_hh_mm_ss_.xmlIt also deleted all the reservations of this particular failed job. So NO major residue left to be cleaned.To summarize: Clone Your workflow and Add the command "Generate Workflow User Input Body in XML" as your first command.    Start Execution, provide your User-inputs and preview it. Be satisfied and Press Okay.   Now Execute it.  After a few scconds this cloned workflow will fail with Error "All done. The Workflow will fail now."     See the command execution logs for this command. You'll see the User-Input XML body. It has also saved the XML file at C:\temp in your WFA server.   Have fun. sinhaa  

    Providing a new version 1.1.0 of the command "WFA Schedular" Changes made: Added conditional String Representation based on the Scheduling parameter provided. Provided check for the right number of parameters passed into the command.Added a new parameter "Expiry Date" to automatically stop the recurring execution upon expiry.Check for Posh3.0 version in code.Have Fun!! sinhaa Below example for:Schedule a workflow for recurring execution every alternate day i.e. once in 2 days at 10:30 PM starting 06-Jul-2015 (Today's date is 02-Jul-2015) . The recurring workflow execution  should expire on 31-Dec-2015 and stop.  

  • How can i read user input value to my User exist

    Hi Guru's,
    I am facing one problem in Variables in BPS.
    I am calculating days from Month/year .I have one variable it is for Days,Second variable it is for Month/Year.
    First variable is user exist (for calculating the days),Second varible is user defined variable(this is a Input to the first variable).
    When i am giving the Month/Year(02/2008)variable i am getting the 29 days from the first variable.again i am changing the value of Month/Yera(03/2008) i am not getting the desired value.
    my doubt is my user exist not able to read current value of variable(month/year).how can i pass my value to user exist because this value is user input value based on this value i am calculating the days and dynamically displaying the layout.
    Here is the my sample code..
    seq = '0000'.
    ind = 0.
       i_area = 'ZTEST1'.
       area_var = 'ZVar2'.
    PERFORM instantiate_object USING    i_area
                                        area_var
                                 CHANGING lsr_var.
    PERFORM get_current_value_of_variable
                            USING lsr_var
                            CHANGING lto_value.
    READ TABLE lto_value INTO lso_value index 1  .
    i_month = lso_value-low.
    iv_month = i_month+4(2).
    iv_year = i_month(4).
    concatenate iv_year iv_month '01' into iv_date.
    begindate = iv_date.
    below bracket code calculating the leap year
    ( IF iv_date+4(2) = lc_feb.
        lv_hlp_date_year = iv_date+0(4).
        lv_hlp_rest      = lv_hlp_date_year MOD 4.
        IF lv_hlp_rest = 0.
          EV_DAYS = lc_days_29.
          lv_hlp_rest = lv_hlp_date_year MOD 100.
          IF lv_hlp_rest = 0.
            lv_hlp_rest = lv_hlp_date_year MOD 400.
            IF lv_hlp_rest NE 0.
              EV_DAYS = lc_days_28.
            ENDIF.
          ENDIF.
        ELSE.
          EV_DAYS = lc_days_28.
        ENDIF.)
      ELSE.
    below bracket code calculating the days
    (   CASE iv_date+4(2).
          WHEN lc_jan. EV_DAYS = lc_days_31.
          WHEN lc_mar. EV_DAYS = lc_days_31.
          WHEN lc_may. EV_DAYS = lc_days_31.
          WHEN lc_jul. EV_DAYS = lc_days_31.
          WHEN lc_aug. EV_DAYS = lc_days_31.
          WHEN lc_oct. EV_DAYS = lc_days_31.
          WHEN lc_dec. EV_DAYS = lc_days_31.
          WHEN lc_apr. EV_DAYS = lc_days_30.
          WHEN lc_jun. EV_DAYS = lc_days_30.
          WHEN lc_sep. EV_DAYS = lc_days_30.
          WHEN lc_nov. EV_DAYS = lc_days_30.
          WHEN OTHERS.   CLEAR EV_DAYS.
        ENDCASE.)
      ENDIF.
    data: st_date(2) type c.
    st_date = '01'.
    ind = 0.
    ind = ind + 1.
    here i am passing the low value and high value.
    yto_charsel-chanm = '0CALDAY'.
    yto_charsel-seqno = 1.
    yto_charsel-sign  = 'I'.
    yto_charsel-opt   = 'EQ'.
    yto_charsel-LOW = st_date.
    yto_charsel-chanm = '0CALDAY'.
    yto_charsel-seqno = 1.
    yto_charsel-sign  = 'I'.
    yto_charsel-opt   = 'BT'.
    yto_charsel-high = ev_days.
    INSERT yto_charsel INTO sto_charsel INDEX ind.
    ETO_CHARSEL = sto_charsel.
    lto_value = sto_charsel.
    How can i pass user input value to read this exist ,some where again i have to write code or else??
    This is very urgent can you help me..

    Hi,
    Instead of two perform statements, use single perform.
    PERFORM get_value USING i_area
                              i_variable
                         CHANGING lw_varsel.
    Take the values from lw_varsel-low.
    FORM statement for this perform is as follows.
    DATA: li_varsel TYPE STANDARD TABLE OF upc_ys_api_varsel,
            lv_varsel TYPE REF TO cl_sem_variable.
      FORM get_value USING p_area TYPE upc_y_area
                           p_variable TYPE upc_y_variable
                     CHANGING
                           p_lw_varsel TYPE upc_ys_api_varsel.
        CALL METHOD cl_sem_variable=>get_instance
          EXPORTING
            i_area       = p_area
            i_variable   = p_variable
             I_CREATE     =
          RECEIVING
            rr_variable  = lv_varsel.
           EXCEPTIONS
             NOT_EXISTING = 1
             others       = 2
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        REFRESH li_varsel.
    ****Getting the Value*********
        CALL METHOD lv_varsel->get_value
          EXPORTING
            i_user     = sy-uname
            i_restrict = 'X'
          RECEIVING
            rto_value  = li_varsel.
        CLEAR : p_lw_varsel.
        READ TABLE li_varsel INTO p_lw_varsel INDEX 1.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
      ENDFORM.                    "get_value
    Try this code.
    Bindu

  • How to retrieve the user input in One Step Screenflow

    Hello all,
    I am new in KM. I would like to ask in One Step Screenflow, I have add a inputfield into the ConfirmComponent. How can I retrieve the user input?
    public IRenderingEvent execute(IScreenflowData sfd) throws WcmException
              inp.setLabel(new Label("Delegation:"));
              ConfirmComponent cc = new  ConfirmComponent(ConfirmComponent.OK_CANCEL,this.context.getLocale(),inp);
              String sRid = (String)this.values.get(0);
              RID rid = RID.getRID(sRid, null);
              OneStepScreenflow oscf = new OneStepScreenflow(sfd,this.getAlias(),rid,cc);
              return oscf.execute();
    In the IRenderingEvent , How to retrieve the user input?
    public IRenderingEvent execute(IResource res, Event event ) throws WcmException
              if (event instanceof ConfirmEvent)
                        ConfirmEvent cce = (ConfirmEvent)event;
                        if (ConfirmEvent.CHOICE_YES.equals(cce.getChoice()))
                                  return new InfoEvent(Status.OK, "Done !");
                        else if (ConfirmEvent.CHOICE_NO.equals(cce.getChoice()))
                                  return ConfirmComponent.onNo(event, res.getContext().getLocale());
                        else if (ConfirmEvent.CHOICE_CANCEL.equals(cce.getChoice()))
                                  return ConfirmComponent.onCancel(event, res.getContext().getLocale());
              return new InfoEvent(Status.ABORT, "Aborted.");
    Many Thanks,
    Sunny

    Hello yoga,
    Many Many thanks for your reply again.
    I have just try the class in the thread link.
    There is a error
    "The project was not built since its classpath is incomplete. Cannot find the class file for javax.servlet.http.HttpServletRequest. Fix the classpath then try rebuilding this project."
    The errors occurs because of "extends OneStepComponent"
    public final class NewConfirmInputComponent extends OneStepComponent
    Where can find javax.servlet.http.HttpServletRequest to include it in my classpath?
    Thanks
    Sunny

  • Quiz Results - Showing the users input

    Could you tell me if there is away to display or print the users input to the questions slides on to one page.
    My Learners take an assessment on their induction course.  Using Trainersoft I can display one page  showing their answers to the questions.  I then print this off and we go through it to see where their strengths and weaknesses are.  I cant seem to do this with Captivate 4.
    I know about review quiz option (one page at a time) but when you have a classroom of up to 16 people it isn't practical.
    Thank you in advance

    Hi,
    Although this may not be an easy one to accomplish in CP4, but still you can use Variables and Scripting to store and display the user responses on a slide.
    Whenever a student answers some question, you can store some strings w.r.t the response, in a user variable (created by you) and then display it using a text caption on a slide. In this way, you can always show the response of the student with a custom message also.
    This will become more easy with the new features of CP5.
    http://www.adobe.com/products/captivate/features/?view=topnew
    Regards
    Chinmay

  • Can 2 different users with 2 different Iphones use the same itunes to backup each phone separately? if not how can I have a backup for 2 different iphones on the same laptop?

    can 2 different users with 2 different Iphones use the same itune program to backup each phone separately? if not how can I have a backup for 2 different iphones on the same laptop?

    Here is your answer:
    http://support.apple.com/kb/HT1495

  • How to restrict the user input textfield to an Integer?

    Hello there;
    Here is my problem, and i need your help.
    I have a mssql 2005 server as my back end database;
    I have designed a web application from which i can load a specific table in my database.
    One of my table column is of integer type and i want to restrict the user to only entered an integer in the textfield.
    I have try the integer converter from the "converters" section of the pallete. The result is that its actually restrict the user input to be an integer, but i can't load the database, obtaining a java.lang.Int error message.
    Next i have tried using int theid=int.parseInt........ but i am receiving a syntax error of the type cannot find symbol parseInt.
    I can't just work this out!
    Could anybody help please.

    As has been stated in previous replies you can check that the value in the TextField is parseable as an Integer by using Integer.parseInt(fieldVariable.getText()). However, you can also restrict what characters can be entered into the text field, like so:
    Assume your field variable is textField1 then the KeyTyped event for the text field:
    private void textField1KeyTyped(java.awt.event.KeyEvent evt) {
         if (evt.getKeyChar() < '0' || evt.getKeyChar() > '9') {
              evt.consume();
    }will only allow the numeric characters (i.e., 0-9) to be typed into the field. Keep in mind that in this case the backspace, delete, home, arrow, etc, keys will not delete characters, move the cursor, etc, so if you want those you have to test for them as well.

  • How we can show the xml data without any attribute in a flex tree (without having any label field) ?

    how we can show the following data in a flex tree (without having any
    label field) ?
    <?xml version="1.0"?>
    <rootNode>
            <childNode>
            < subchildNode >
                    <valueNode>1000</valueNode >
                    < valueNode >999-888-777</valueNode >
                    < valueNode >STORTZ</valueNode >
                    < valueNode >PAM STORTZ</valueNode >
                    < valueNode >88 ST. MORTON ROAD</valueNode>
            </subchildNode>
            </childNode >
    </rootNode >

    as is - no how
    wrap those xml chunk with a class having clear public properties like:
    public class dataRecord {
         protected var xml:XML;
         function dataRecord(xml:XML) {
              this.xml = xml;
         public function get id ():String {
              return XML(xml.descendants("valueNode")[0]).toString();
         // and so on
    simpliest way is to change xml structure to use attributes than wrapping that thing with AS code, it's time consuming and non efficient.

Maybe you are looking for