Capturing button input...

What is up?
I'm new to the Java language and I'm having some trouble. Any help would be most welcome and appreciated.
I'm using JOptionPane to display and accept input from the user, but I can't figure out how to "listen" for the "cancel" button and then react to it in my own way. I have searched everywhere, and all I can find is either some code that is way over my head, or suggestions such as adding a "listener". I have no idea what that means and all the examples I've seen are much too complicated for me to try and reuse the part of the code I think I need.
Thanks in advance>>>

Thanks alot!
I'll try it out
--peace                                                                                                                                                                                                                           

Similar Messages

  • Owb - Capturing user input classes

    Hi,
    I'm using OWB 9.2.0.3 and I'm looking at creating some OMB*Plus scripts to deploy (instead of using the GUI)
    I noticed in the sample code (on OTN) for OWB, some classes for "capturing user inputs" in OMB*Plus. I think that this would be a great addition to my scripts (instead of hard coding userid and password).
    How do I get this to work? What do I do with these classes? where to put them? and would you have any documentation on how to code this in OMB*Plus.
    Thank you very much.
    Guy LaBelle

    Guy,
    The description is missing... and I will submit this right away to be added. The link will be with the location of the downloadable file. Will be there within the next couple of days.
    Now, without the screenshots (hope this helps to some extend):
    The omb_params zip file contains classes for a generic modal dialog that can be used from OMBPlus for capturing user input. It will support parameters that are text or passwords. If you unzip this file into owb\bin\admin you can try the dialog from OMBPlus.
    The Java can be invoked by calling as follows;
    # java::new oracle.owb.samples.CaptureParams {
    # display_string_list display string for dialog ie. {"Hostname", "Port", "Service"}
    # param_name_list to query after dialog is complete ie. {"vhostname", "vport", "vservice"}
    # param_type_list STRING or STRINGHIDE or list of tokens (comma separated) for combo box
    # title_string_for_dialog Title for the dialog.
    # dialog_prompt_string Prompt string for dialog.
    or
    # java::new oracle.owb.samples.CaptureParams {
    # display_string_list display string for dialog
    # param_name_list to query after dialog is complete
    # param_type_list STRING or STRINGHIDE or list of tokens (comma separated) for combo box
    # title_string_for_dialog
    # dialog_prompt_string
    # ok_button_string
    # cancel_button_string
    or
    # java::new oracle.owb.samples.CaptureParams
    # title_string_for_dialog
    # dialog_prompt_string
    # ok_button_string
    # cancel_button_string
    There is a Java accessor methiod named 'okButton' that will return a boolean (in Java), the Tcl shell will return 0 for false, and 1 for true. This can be used to determine if the user has pressed the OK or cancel button. Since the user can define the text for these buttons, they can be used for Yes/No style questions for example.
    5.1 Example to capture user input;
    The following dialog can be created with the Tcl below;
    The Tcl to create this dialog is show below, this creates a modal dialog to capture the user input for username, password (in password field), connection string and an option selectable from a combo box;
    set pars [java::new {String[][]} 3 {{"User" "Password" "Connect" "Option"} {"user" "pass" "connect" "option"} {"STRING"
    "STRINGHIDE" "STRING" "thick,thin"}} ]
    set jtitle "OWB Migration"
    set jprompt "Please enter migration properties:"
    set paramList [java::new oracle.owb.samples.CaptureParams $pars $jtitle $jprompt]
    # To check whether OK or cancel is pressed used retrieve okButton/cancelButton on object, then check value (0 - false, 1 - true)
    set okpressed [$paramList okButton]
    # To retrieve the parameters invoke getValue passing the parameter name, the user is stord in a variable (for example);
    set userval [$paramList getValue "user"]
    set passval [$paramList getValue "pass"]
    set connectval [$paramList getValue "connect"]
    set optionval [$paramList getValue "option"]
    5.2 Example to create a question-style dialog;
    set paramList [java::new oracle.owb.samples.CaptureParams "OWB Dimensional Design" "Do you want to create a cube?" "Yes" "No"]
    Like the example above the 'okButton'/'cancelButton' methods can be used to query the button that was selected.
    Thanks,
    Mark.

  • How to capture text input value by user in a LOV search popup page?

    I need to capture the input by the user in LOV search page. I added one controller in the LOV region, and the flow is also working, but what I need to hold the search input in the search popup page. Also do you know what is the id of " Search Term" text input? then I can try to hold the value in PFR of the CO.

    Hi Sandeep,
    Yes, as of now I need to populate blank, so I need to modify the SQL, therefore I need to capture the value which is given by the user. I am trying to capture the value through passive criteria, but not able to get the result. I added below code in PFR of lov region controller,
           Dictionary passiveCriteriaItems = pageContext.getLovCriteriaItems();
           String lov = (String)passiveCriteriaItems.get("SwitchLOV");
          if ((lov != null) && !("".equals(lov)))
               throw new OAException(lov, OAException.INFORMATION); 
    SwitchLOV is a lov map I have added in the LOV, and
    Programmatic Query set to true. and
    LOV Region Item is the id for which user searches.
    I am getting null in the "lov" where i have give some value in the search field.
    Is this would be the way?
    I dont understand where is the issue, Please suggest.

  • Capture keyboard input

    I have a swing app that will run on a touch screen. There will be no keyboard. I will have a magnetic card reader plugged into the ps/2 port.
    Basically I need to capture the output of the magnetic card reader. At the moment when a card is swiped it goes in the first JTextfield.
    Now I can capture the output outside of swing by using
    BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
    String data = stdin.readLine();
    System.out.println(m_data);
    However this does not work inside of swing or at least my swing app.
    So in swing, how can I capture or redirect text input?
    I guess I could write a fuction that appends a character each time a key event occurs like KeyTyped. However I am not sure that is the most efficient way to go about it.

    A document listner might work, however I think that url you posted also shows a way using an action listner.
    Something I forgot to mention was, when I swipe the card I do not want the card's data placed in a JTextField.
    To the point when a card is swiped I want the data in a string.
    At the moment when I swipe a card it goes into a JTextfield. I do not want that to be the case. Sure I can make a way around it with a hidden text field or something, and use a listner for events on the text field.
    However I do not think that is the proper way to go about this.
    So I am looking for an event that will be fired or take place as soon as there is input from the keyboard/card reader. I do not want a JTextField to even have the chance to grab and display that data. I want to know first, and take that data and do something else with it.
    In detail, when a card is swipped, the data will be parsed and JTextFields will display the parsed information. However I need to be the first one receiving the data, not any of the JTextFields in my app.
    The app does not require use of a keyboard. If possible I would like the app to not work at all with a keyboard, and any input from a keyboard or card reader is calling my own code to deal with those events.
    So if someone does plug in a keyboard, I do not want them to be able to do anything. That's not a must, but if I can accomplish it with the above I will be a happy camper.
    In short I need to capture all input from the ps/2 port, and be notified with input starts and ends. Or at least when it ends.
    Any suggestions are greatly appreciated.

  • Unable to capture button event in pageLayout Controller

    Hi Guys,
    I have the following layout
    pageLayout
    pageLayoutCO (controller)
    ----header (Region)
    ----------messageComponentLayout (Region)
    -----------------MessageLovInpurt
    -----------------MessageChoice(Item)
    -----------------MessageTextInput
    -----------------MessageLayout
    ----------HideShow (Region)
    -----------------MessageLovInpurt(Item)
    -----------------MessageChoice(Item)
    -----------------MessageTextInput(Item)
    -----------MessageComponentLayout (Region)
    -----------------MessageLayout
    ------------------------SubmitButton(ID:SearchBtn)
    ------------------------SubmitButton(ID:ClearBtn, fires partial action named clear)
    -----------header(Region)
    I am not able to capture the event fired by the button ClearBtn in the controller of the pagelayout.....
    The two methods I used as follows aren't worked:
    if ("clear".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM)))
    if (pageContext.getParameter("ClearBtn") != null) {
    what should i do in order to capture the button event in the pageLayout Controller
    Thanks in advance
    Mandy
    Edited by: user8898100 on 2011-8-2 上午7:49

    Mandy,
    Its really strange that its not able to caputure the event in CO.
    Below is the way in which we handle to Submit action at CO level.
    /Check whether ClearBtn is same in case too.
    if(pageContext.getParameter("ClearBtn")!=null){
    System.out.println("Inside the Clear Btn Action");
    Regards,
    Gyan

  • How to capture user input for customer exit processing?

    I need to calculate the number of working days elapsed in the current fiscal quarter BASED on the USER INPUT on the reporting front.  i.e., say the fiscal quarter started on 1 July 2005 and if the user enters 10 July 2005, I should get the value 8 (Assume that Monday through Friday are all workdays).  If the user enters 12 July 2005, I should get 10.  I have written customer exits and know how to use factory calendar, but <b>THE CHALLENGE</b> is how do I <b>CAPTURE</b> the user input and use it in my exit?  During the varible definition, if I select the check box "Ready for input" then the customer exit is not being processed and unless I check that box I can't get a user entry!  If I look at the import values in the customer exit, I see i_t_var_range with type rrs0_t_var_range.  My strong feeling is that this parameter gets the user input, but I am unable to use it as the customer exit is not being called if I make the user to input the data.  Based on the empirical evidence, I felt that user input and customer exit can not co-exist!!  Please somebody prove me wrong and let me know how can I use the user input to process my "customer-exit" variable.  I would really appreciate any input from the BW community here.

    Hi Sameer,
    Most likely, I'm missing something, but I think that the answer is very simple.
    CASE I_VNAM.
    WHEN 'YOUR_CUSTOMER_EXIT_VAR'.
    IF I_STEP = 2. “ After selecting of input variable
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
    WHERE VNAM = 'USER_INPUT_VAR'.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = LOC_VAR_RANGE-LOW(4).
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDLOOP.
    ENDIF.
    ENDCASE.
    In this typical user exit coding you have a user entered value in LOC_VAR_RANGE (originally in I_T_VAR_RANGE) and you construct your user exit variable value in E_T_RANGE.
    Best regards,
    Eugene
    Message was edited by: Eugene Khusainov

  • How to capture Button Click in OAF

    Hi All,
    I have created a button "TestButton" using personalization. On the click of this button, a new page "TestPG" opens. But i have to pass a few parameters from the old page to the new page. How do i capture this button click event in the CO so that i can use the pageContext.forwardImmediately method to pass the parameters?
    Also, what is the difference between a Button and a SubmitButton?
    Regards,
    Shreyas

    I never tried this... But can suggest you something.....
    Create a Upload type of item in your region, which will allow you to browse your Image file.
    Attach a VO attribute which will be based on EO. VO attibute will be based on Databse column of BLOB type, which will store the image in DB.
    If you want to transfer this file to application server's any directory, you can do that also.
    But above is solution to your problem..

  • How to Capture Button event on TrainBean navigation

    Hi All
    i m being required to capture a button event in train bean Navigation, i m doing customization in Iexpense Module,here in Create IExpenseReport i need to capture the events of Remove,Return etc.how is it possible any clue would be very helpful.
    Thanx
    Pratap

    try this..
    if (GOTO_PARAM.equals(pageContext.getParameter(EVENT_PARAM))
    "NavBar".equals(pageContext.getParameter(SOURCE_PARAM))
    // This condition checks whether the event is raised from Navigation bar
    // and Next or Back button in navigation bar is invoked.
    int target = Integer.parseInt(pageContext.getParameter(VALUE_PARAM));
    // We use the parameter "value" to tell use the number of
    // the page the user wants to visit.
    String targetPage;
    switch(target)
    case 1: targetPage = "/oracle/apps/dem/employee/webui/EmpDescPG"; break;
    case 2: targetPage = "/oracle/apps/dem/employee/webui/EmpAssignPG"; break;
    case 3: targetPage = "/oracle/apps/dem/employee/webui/EmpReviewPG"; break;
    default: throw new OAException("ICX", "FWK_TBX_T_EMP_FLOW_ERROR");
    HashMap pageParams = new HashMap(2);
    pageParams.put("empStep", new Integer(target));
    pageContext.setForwardURL("OA.jsp?page=" + targetPage,
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    pageParams,
    true, // Retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO, // Do not display breadcrumbs
    OAWebBeanConstants.IGNORE_MESSAGES);
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Not able to capture button event in extended controller

    Hi Gurus,
    I am not able to capture the button event (of seeded controller) in extended controller.
    I have written code in extended controller like below:
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean){
        String str = pageContext.getParameter("event"); // copied from seeded controller for the button event //
          if ("editLines".equals(str)) {
            //cutom validation
      super.processFormRequest(pageContext, webBean);
    Please help me in resolving the issue.
    Thanks,
    Srinivas
        ///my cutom validateion

    Hi Bm,
    Thanks for your response.
    I have tried the same but no luck.
    Please help in getting this resolved.
    Thanks,
    Srinivas

  • Not able to capture button event in pageLayout Controller

    Hi Guys,
    I have the following layout
    pageLayout ------------------------ pageLayoutCO (controller)
    ----messageComponentLayout (Region)
    ----------messageComponentText (item)
    ----------messageComponentText (item)
    ----------messageComponentText (item)
    ----------messageLayout (Region)
    ----------------header(Region)
    ----------------------button (item) (say BTN1) (fires partial action)
    I am not able to capture the event fired by the button BTN1 in the controller of the pagelayout..... but if i set a controller at the messageComponentLayout iam able to capture the event.
    what should i do in order to capture the button event in the pageLayout Controller
    Thanks in advance
    Tom.

    Tom,
    Two things:
    1)The button ur using is of type submitbutton or button?.In this scenario it should be button.
    2)The correct coding practice is using:
    if("QUERY".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM)))
    instead of
    String _event = pageContext.getParameter("event");
    if("QUERY".equals(_event))
    because you never know if Oracle in any upgrade or patch change the value of the constant EVENT_PARAM in class OAWebBeanConstants.
    3)If first point is followed by you, just match the exact event name in code and in property inspector for the button.
    --Mukul
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Can I Capture Screen Input (instructional video type stuff)

    Hi,
    Before buying QT7Pro, was wondering if anyone can tell me:
    - Will it let you record input from an application Window?
    I have a complex application for which I'm trying to build some sample QT movies. I saw some of the other threads, but I gathered that the complaint was that it didn't support direct input from an external source like a camera. Not sure if there's a difference here.
    Thanks in advance,
    Greg

    I use Snapz Pro (Ambrosia Software) on my Mac to record screen captures and mouse movements as QuickTime movies.
    There must be a similar screen record utility available to PC users.
    The Pro version of QT doesn't record the viewers display.

  • Capturing Batch Input Log without keeping BDC session

    Hi all -
    Would like to capture the Batch Input log and keep it persistent in some manner (for example using an application log) without keeping the corresponding BDC session.  The reason for this is that any manual corrections to data interfaces through BDC sessions MUST be logged indefinitely for audit purposes.  The actual BDC sessions are HUGE and therefore precludes saving the entire BDC session.  My thoughts are user-exit'ing in BDC session either as a Batch Input Log is being created or when a Session is being deleted (NOTE: running ECC 6.0 which has new enhancement concept permitting extremely flexible user-exit'ing so exit points are NOT an issue and repair/core mode not required).  Anyone see any flaws with this approach or can recommend perhaps a simpler or standard approach so that Batch Input Logs are retained indefinitely whereas the Session is deleted?
    Many thanks,
    Pat

    Hi Pat,
    Why dont you try archiving?
    For archiving, archive object BDCLOGPROD can be used. if archived, then you can read the archived logs using program RSBDC_ARCHREAD (also accessible from SARA->Read).
    See some notes if it is helpful:
    147354, 18319, 24438, 18307
    Also have a look at the Data Management Guide available at service.sap.com/data-archiving.
    Hope this helps,
    Naveen

  • How to capture user inputs from Enter_query command?

    When the user enters query(F7) and inputs some field parameters...how do I capture those variables after they execute the query?
    Example:
    -Table ABC has a column called NAME
    -They enter '%BOB% in the NAME field
    -They press F8 (enter-query)
    I've tried using:
    message( get_block_property('ABC', DEFAULT_WHERE)) to see what's in there and it returns a null. I know that if I hit F7 twice, I can see '%BOB%' displayed in the field. Is there a way to see this without hitting F7 twice?
    Thanks.

    -Table ABC has a column called NAME
    -They enter '%BOB% in the NAME field
    -They press F8 (enter-query)
    ? F8 = execute-query
    however. Use the PRE-QUERY and write your message there and show the value of :ABC.NAME
    that's it
    Gerd
    PS: Without hitting two times F7 you have NO chance to get the value of %BOB%. this is an internal cache mechanism of the forms runtime and only hitting two times F7 gives you the information which forms has remembered in a local cache.

  • Capturing user input from a message choice..urgent!!!!!!!!!!

    Hi All,
    I am working on OAF 5.7H with a Travel Module for a UN organisation .
    I have a pge in which I have table Region.In the table i have a message choice Box displaying different Travel Types.In the same row i have a check box with Yes or No value
    my requirement is ,whenever the user selects some particular travel types(the page gets refreshed) from the message choice,the check box should be rendered or hidden.
    For example
    if the user selects travel type MISSION in the message choice ,the page refreshes and the check box shud not be rendered
    and
    if the user selects travel type HOME LEAVE,the page refreshes and the check box shud be rendered.
    But my problem is i am not able to capture the user selection of the message choice and at the same time render the chek box true or false.
    If i kan capture the user selection of the message choice values while the page refreshes then at the same time i kan play around with the chekBox.
    First of all is this possible and if kan anyone give me a little clue.

    Thanks Ram for your reply..I did this but it doesnt seem to work..Because now i realize the problem is somewhere else.
    I have a Table RN as i said.
    In that table region all the componenets are added in stack layout,i mean to say every stack layout region gets added coloumn wise to the table.
    Now i have a Add Anather Row Button.
    My requirement is :
    Suppose the user selects Travel Type Mission on first row,The page gets refreshed and the chekBox doesnt get rendered.
    Now if the user hits Add Anather Row Button and creatres a new row and selects the travel type to be HOME LEAVE whereby the check box shud get rendered in that row.
    But the problem is this is not happening.
    i am doing as u said..
    Now if i choose a Travel type in the second row which shud hide the chekbox then in all the rows the Check Box gets hidden,even in the previous row where it shud be rendered.
    This is happening because each of the stack layout region conataining the chek boxes get added as coloumn to the entire table,
    So if i do any manipulation on the chek box it gets defaulted for all the rows.
    I dont know what to do ..
    i need to handl eit row wise.
    I am iterating through the row set to capture the travel types in each row.
    But on the row set i cannot set any web bean property.
    somebody please tell me ho wto crack this.
    Thanks

  • CAPTURE ANALOG INPUT DROP

     I have 3 analog inputs which I continuously read and display the scaled results on 3 gauges (voltage converted to pressure 0v=0Bar 10v=300Bar) the final part of my test is to record the pressure drop of one of the analog input channels from 280Bar to 0Bar this should only take 70mS, and display this on a graph against time. Im struggling to find a way to capture this I have had a look ath the Daq examples but just dont seem to get this to work. Any help would be great.

    Hi
    Check the below image. Might help to acquire data. I think you have to sample higher than 70msec for reading the channels.
    Let me know if you have problem.
    Thanks
    Viral

Maybe you are looking for

  • Upload of PO Approval Workflow Customization showing errors.

    Hi, As per the client requirement, I have customized the PO approval Workflow For customization i did take care that only those standard workflow processes are customized which are prescribed by Oracle as customizable. For ex: PO Approval Top Process

  • Let me know about oracle apps

    i am a trainee software engg. can u let me know about oracle apps/financials etc. i m keen to know about it as in near future i may be working on it. let me know where do i get the technical know how etc. null

  • BSET table updation

    Hi We are changing the cart of account. The actual FI postings happen to the new GL account but in the TAX data tab, I still see the old GL accounts. Can any one help me how to default the TAX data segment to consider GL account from the New Chart of

  • Satellite A300-1J1 - Some FN keys are not working

    My FN key seems to have half broken. When I press it usually the icons would appear on top of my screen now it doesnt and all the function keys like F1 F2 F3 etc work with the FN key except F4 which hibernates the computer, also the light turn on und

  • Ipad unplugged during restore

    Hello my ipad mini got unplugged during a restore and now it is stuck on an apple logo with a bar underneath,i tried to restore it but it says could not restore because an error occured what can i do?