How to pass events from enclosed JApplet to enclosing JFrame?

Perhaps a bit of an obscure problem, but I have an application here that involves displaying JApplets within a JFrame. As long as I do nothing to give the displayed JApplet focus, I am able to use keyboard shortcuts to access my various JMenu items. However, the moment I interact with the JApplet and it gets focus (say, by entering text in a JTextField), those keyboard shortcuts no longer work.
I imagine what's happening is that the JApplet assumes that it must be the root component and does not pass events up to the superclass. Is there any way to allow the events to be passed on from the JApplet to the enclosing JFrame? Is this even possible?
Any help would be greatly anticipated.
- Fromage

Hi FTD,
I just about get your example; it is like a containment hierarchy right - one current, one proposed?
If it is required that there is only one base class to maintain, I am positive this can be satisfied. I suppose our ideas are similar... the point I was trying to make though is that you can implement you AnalysisClasses independent of the top-level container it resides in. The JApplet itself perhaps just needs to handle/marshal <applet> parameters (if any) while the JFrame has only JFrame specific initalisation to take care of - this can feasibly be done from the main method of the AnalysisClass. Effectively you get:
JFrame --> JDesktopPane --> JInternalFrame x 3 --> AnalysisClass
or
JApplet --> AnalysisClass
I do not fully understand what role the BaseGUIClass has... in my example, I have omitted it assuming its functionality could be redistributed to AnalysisClass or one of JInternalFrame or JApplet. Does it contain a lot of initialisation code and therefore am I wrong to make this assumption?
'The application GUI itself is simple...', would this be the AnalysisClass and does this mean it can be dropped into a JFrame or JApplet and manage itself? If so, but not to annoy you, I would still recommend the JInternalFrames.
I think it would frustrate me quite a bit if my superiors were rigid... it is very possible to implement this so that there is only one version of a class to maintain. The question is how much programming is required to achieve this. In my opinon, not a lot; perhaps with respect to your bosses/dealines, too much.
Here's an idea:
public class ApplicationGUI extends JApplet
    public void initialise()
        AnalysisClass tool = null;
        switch (Integer.parseInt(getParameter("toolType")))
            case 1:
                tool = ....
            break;
            case 2:
                tool = ....
            break;
            case 3:
                tool = ....
            break;
        if (tool != null)
            setContentPane(tool);
    public void start()
    public void stop()
    public void destroy()
    public static void main(String[] args)
        JFrame jFrame = new JFrame("Application Name");
        JDesktopPane jDesktop = new JDesktopPane();
        JInternalFrame jiFrame1 = new JInternalFrame("Tool 1", true, true, true, true);
        JInternalFrame jiFrame2 = new JInternalFrame("Tool 2", true, true, true, true);
        JInternalFrame jiFrame3 = new JInternalFrame("Tool 3", true, true, true, true);       
        jDesktop.add(jiFrame1);
        jDesktop.add(jiFrame2);
        jDesktop.add(jiFrame3);
        jFrame.setContentPane(jDesktop);
        jFrame.setVisible(true);
}BTW if you managed to add the JApplet to a JPanel, why couldn't you add it to the JFrame?
Kind regards,
Darren
ps. are you based in England?
pps. apologises for making your name sound like STD, lol
ppps. apologies for posting code when you prob don't want it... I am at work, bored.

Similar Messages

  • How to pass events from subpanel(s) to the main VI ?

    hi all,
    I found a lot of solutions to pass the events from the main VI to the subpanel(s) but none about passing the events from subpanel(s) to the main VI. In the attached VIs, I just want to generate an event in the main_VI.vi when I click on the button positionned in the subPanel1.vi. How can I do that ?
    thanks.
    Cedric
    Attachments:
    main_VI.vi ‏13 KB
    subPanel1.vi ‏6 KB

    Cedric,
    You could use a queue to transfer the button data to your main vi.
    See the attached files:
    subPanel1mod - Detects a button change and Enqueues the state.
    main_VI mod - uses the Timeout event to poll for data in the queue.
    main_VI mod1 - gets the queue data without having to poll.
    Like your orginals, these files are in LV2010.
    steve
    Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
    question. Give "Kudos" to replies that help.
    Attachments:
    subPanel1mod.vi ‏10 KB
    main_VI mod.vi ‏16 KB
    main_VI mod1.vi ‏15 KB

  • How to pass Data from one form to the other

    Hi all
    Can any one suggest me how to pass data from one form to the other form, which i zoomed from the original one?
    I tried to do this by passing parameter in Event Procedure but i am getting error msg when i am opening the zoomed form.
    If any one of u have any idea, give me a reply
    Thank you
    Suhasini

    If you choose the second alternative you should erase these global variables after the second form is opened
    You can erase the global variable using:
    erase('global_var')
    Greetings,
    Sim

  • How to get event from message?

    Hi,All:
    I write a run-time interface by CVI, I use TS_EngineRegisterUIMessageCallback to register my callback function, but when message passed to the callback function, as the type is struct IDispatch but not CAObjHandle, I don't know how to read event from message.
    Can you help me to solve it? Thanks
    Chang Zhang

    Hello Chang-
    If your question is simply how to obtain an object handle from an object of type IDispatch, have you investigated the function "CA_CreateObjHandleFromIDispatch"? I would recommend you look over the testexec.prj that is installed along with the TestStand engine (the CVI Operator Interface) and inspect how we handle our callbacks, this may help you understand how to go about emulating the behavior in your own project. To see this particular function in use it may be most helpful to look in the file 'engine.c' and inside the function UIMessageDeferredCallback here you will see the IDispatch pointer being handled and decoded for use by the TS engine.
    Regards,
    Elaine R.
    Applications Engineering
    National Instruments
    http://www.ni.com/ask

  • OBIEE 11g How to pass variable from one prompt to another prompt in dashboard page.

      How to pass variable from one prompt to another prompt in dashboard page.
    I have two prompt in dashboard page as below.
    Reporttype
    prompt: values(Accounting, Operational) Note: values stored as
    presentation variable and they are not coming from table.
    Date prompt values (Account_date, Operation_date)
    Note:values are coming from dim_date table.  
    Now the task is When user select First
    Prompt value  “Accounting” Then in the
    second prompt should display only Accounting_dates , if user select “operational”
    and it should display only operation_dates in second prompt.
    In order to solve this issue I made the
    first prompt “Reporttype” values(Accounting, Operational) as presentation
    values (custom specific values) and default presentation value is accounting.
    In second prompt Date are coming from
    dim_date table and I selected Sql results as shown below.
    SELECT case when '@{Reporttype}'='Accounting'
    then "Dates (Receipts)"."Acct Year"
    else "Dates (Receipts)"."Ops
    Year"  End  FROM "Receipts"
    Issue: Presentation variable value is not
    changing in sql when user select “operation” and second prompt always shows
    acct year in second prompt.
    For testing pupose I kept this presentation
    variable in text object of dashboard and values are changing there, but not in
    second prompt sql.
    Please suggest the solution.

    You will want to use the MoveClipLoader class (using its loadClip() and addListener() methods) rather than loadMovie so that you can wait for the file to load before you try to access anything in it.  You can create an empty movieclip to load the swf into, and in that way the loaded file can be targeted using the empty movieclip instance name.

  • How to   Pass Parameter from BIP  to Dashboard  Report

    Hi,
    Parameter from BIP to Dashboard Report
    If I select BIP report paremeter should pass value to dashboard report
    thanks in advance.
    CHEERS ,
    Jel

    Hi Saichand,
    I hav gone through above link its passing values from Dashboard prompt to BIP report only..
    just i need like reverse (if i click on BIP report value then it should pass that value to Dashboard reports) in this this case how to pass parameter from BIP to dashboard report
    Thanks in advance
    Cheers,
    Jel

  • How to pass text from flash to html?

    how to pass text from flash to html?

    This is a wonderful sample i found online.
    pls run using a server so that it can display properly
    http://active.tutsplus.com/tutorials/actionscript/flash-html-javascript-externalinterface/

  • How to pass data from offline form to webdynpro java

    Hi,
    Please suggest me how to pass data from offline from to webdynpro java node?
    i am using the below code to pass data from offline form(after entering values in the form) to node . i am using form upload ui element to upload offline form and after that i am providng a button to update data.But still i am not able to see data in the node.Any suggestions on this.below code is wriiten on action of the button.
    wdContext.currentContextElement().setPDFSource(null);
           try
                if(null!=wdContext.currentContextElement().getAttributePointer("Resource"))
           IWDResource fileResource = wdContext.currentContextElement().getResource();
         if("PDF".equalsIgnoreCase(fileResource.getResourceType().getFileExtension()))
           byte[] b = new byte[wdContext.currentContextElement().getResource().read(false).available()];
           wdContext.currentContextElement().getResource().read(false).read(b)                     wdContext.currentContextElement().setPDFSource(b);
           WDInteractiveFormHelper.transferPDFDataIntoContext                 (wdContext.currentContextElement().getPDFSource(), wdContext.nodeVn_TestData());                                                               
                     else
                          wdComponentAPI.getMessageManager().reportException("Please enter correct file");
                else
                     wdComponentAPI.getMessageManager().reportException("Error while uploading file"); 
           catch (Exception e) {
                wdComponentAPI.getMessageManager().reportException
                ("Error in uploading the Adobe Form :"+e.getLocalizedMessage(),false);
    Regards,
    Pavani

    If you choose the second alternative you should erase these global variables after the second form is opened
    You can erase the global variable using:
    erase('global_var')
    Greetings,
    Sim

  • How to pass data from one internal session to another internal session

    hi all sap experts ,
    How to pass data from one internal session to another internal session and from oneExternal session to another external session.
    Except : Import and Export parameters and SPA/GPA parameters.
    Tell me the otherWay to pass data ..
    Plz
    Thanks in advance

    hi,
      abap memory management u will understand about this concept.
    the import /export parameter will help u that passing data between two internal sessions by using abap memory.
      for syntax
    Passing Data Between Programs
    There are two ways of passing data to a called program:
    Passing Data Using Internal Memory Areas
    There are two cross-program memory areas to which ABAP programs have access (refer to the diagram in Memory Structures of an ABAP Program) that you can use to pass data between programs.
    SAP Memory
    SAP memory is a memory area to which all main sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another. Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters can be set either for a particular user or for a particular program using the SET PARAMETER statement. Other ABAP programs can then retrieve the set parameters using the GET PARAMETER statement. The most frequent use of SPA/GPA parameters is to fill input fields on screens (see below).
    ABAP Memory
    ABAP memory is a memory area that all ABAP programs within the same internal session can access using the EXPORT and IMPORT statements. Data within this area remains intact during a whole sequence of program calls. To pass data to a program which you are calling, the data needs to be placed in ABAP memory before the call is made. The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory. If control is then returned to the program which made the initial call, the same process operates in reverse. For further information, refer to Data Clusters in ABAP Memory.
    Filling Input Fields on an Initial Screen
    Most programs that you call from other programs have their own initial screen that the user must fill with values. For an executable program, this is normally the selection screen. The SUBMIT statement has a series of additions that you can use to fill the input fields of the called program:
    Filling the Selection Screen of a Called Program
    You cannot fill the input fields of a screen using additions in the calling statement. Instead, you can use SPA/GPA parameters. For further information, refer to Filling an Initial Screen Using SPA/GPA Parameters.
    Message was edited by:
            sunil kumar
    Message was edited by:
            sunil kumar

  • How to pass data from one internal session to another

    Hi SAP Experts,
    How to pass data from one internal session to another and from One external session to another external session. I used import and export parmeter and SPA/GPA parameters. What is the other way to pass data?
    Please tel me urgently
    Thank you
    Basu

    Memory Structures of an ABAP Program
    In the Overview of the R/3 Basis System you have seen that each user can open up to six R/3 windows in a single SAPgui session. Each of these windows corresponds to a session on the application server with its own area of shared memory.
    The first application program that you start in a session opens an internal session within the main session. The internal session has a memory area that contains the ABAP program and its associated data. When the program calls external routines (methods, subroutines or function modules) their main program and working data are also loaded into the memory area of the internal session.
    Only one internal session is ever active. If the active application program calls a further application program, the system opens another internal session. Here, there are two possible cases: If the second program does not return control to the calling program when it has finished running, the called program replaces the calling program in the internal session. The contents of the memory of the calling program are deleted. If the second program does return control to the calling program when it has finished running, the session of the called program is not deleted. Instead, it becomes inactive, and its memory contents are placed on a stack.
    The memory area of each session contains an area called ABAP memory. ABAP memory is available to all internal sessions. ABAP programs can use the EXPORT and IMPORT statements to access it. Data within this area remains intact during a whole sequence of program calls. To pass data to a program which you are calling, the data needs to be placed in ABAP memory before the call is made. The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory. If control is then returned to the program which made the initial call, the same process operates in reverse.
    All ABAP programs can also access the SAP memory. This is a memory area to which all sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another. Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters are often used to preassign values to input fields. You can set them individually for users, or globally according to the flow of an application program. SAP memory is the only connection between the different sessions within a SAPgui.
    The following diagram shows how an application program accesses the different areas within shared memory:
    In the diagram, an ABAP program is active in the second internal session of the first main session. It can access the memory of its own internal session, ABAP memory and SAP memory. The program in the first internal session has called the program which is currently active, and its own data is currently inactive on the stack. If the program currently active calls another program but will itself carry on once that program has finished running, the new program will be activated in a third internal session.
    Data Clusters in ABAP Memory
    You can store data clusters in ABAP memory. ABAP memory is a memory area within the internal session (roll area) of an ABAP program and any other program called from it using CALL TRANSACTION or SUBMIT.
    ABAP memory is independent of the ABAP program or program module from which it was generated. In other words, an object saved in ABAP memory can be read from any other ABAP program in the same call chain. ABAP memory is not the same as the cross-transaction global SAP memory. For further information, refer to Passing Data Between Programs.
    This allows you to pass data from one module to another over several levels of the program hierarchy. For example, you can pass data
    From an executable program (report) to another executable program called using SUBMIT.
    From a transaction to an executable program (report).
    Between dialog modules.
    From a program to a function module.
    and so on.
    The contents of the memory are released when you leave the transaction.
    To save data objects in ABAP memory, use the statement EXPORT TO MEMORY.
    Saving Data Objects in Memory
    To read data objects from memory, use the statement IMPORT FROM MEMORY.
    Reading Data Objects from Memory
    To delete data clusters from memory, use the statement FREE MEMORY.
    Deleting Data Clusters from Memory
    please read this which provide more idea about memory
    Message was edited by:
            sunil kumar

  • How to export events from iPhoto in Iphone 5 to Mac?

    How to export events from iPhoto in Iphone 5 to Mac? Thanks

    Is this waht you want to do?
    It's built into the File Export function of iPhoto 9 (11).  Select what every photos you want and use that option to put each photo in a folder with the Event title it came from as in this test of six randomly picked photos:
    OT

  • How to pass arguments from PAPI to the process

    Can any one tell me How to pass arguments from PAPI to the process.

    The link Creating a new work item instance in a process using PAPI shows how to create instances on PAPI and pass in the variable information as they are being created.
    Provide some additional detail if you're interested in seeing how to pass in variable information using PAPI for scenarios other than instance creation.
    Dan

  • How to pass data from list to internal table

    Sir,
    Please tell me how to pass data from list display to internal table. Some fields in the list display are input fields .These are added at run time and these added values should be stored in the internal table

    Follow this code sample:
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
        I_CALLBACK_PROGRAM                = W_REPID
        I_CALLBACK_PF_STATUS_SET          = 'PF_STATUS'
        I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
    FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM
                            P_SELFLD TYPE SLIS_SELFIELD.
    case p_ucomm.
    when '<Some user Action>'.
      Data ref1 type ref to cl_gui_alv_grid.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
    E_GRID = ref1.
    call method ref1->check_changed_data
    * Your internal table will have the data
    endcase.
    ENDFORM.
    Regards,
    Ravi

  • How to pass value from jsp to java bean

    I have huge problem . How to pass value from jsp value to java bean.Please replay me soon

    Use the <jsp:setProperty> tag. There are several ways to use it. The one you probably want is:
    <jsp:setProperty name="bean_name"  property="property_name"  value="the_value_you_want_to_set"/>

  • How to Pass Variables from One Application to Another Pop Up Window

    Hi,
    I am wondering if anyone on the list has tried calling up a
    pop up manager, and have two other variables imported for secondary
    usage. I have tried using [Bindable], but this does not seem to be
    working, and I am still getting errors that tells me that the
    variables are "not defined" when it gets passed to another
    HTTPService. I tried embedding the Pop Up Manager in the same
    application as the one that is supposed to "pass the variables,"
    but it no longer acts as a pop up window.
    Could anyone please tell me where I can find the answers for
    this?
    Thanks in advance.
    Here is the code of what I have for my pop up manager:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:TitleWindow xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical"
    title="New Scenario"
    showCloseButton="true"
    width="325"
    height="145" horizontalScrollPolicy="off"
    close="titleWindow_close(event);">
    <mx:Script>
    <![CDATA[
    import mx.events.CloseEvent;
    import mx.managers.PopUpManager;
    import mx.controls.Alert;
    [Bindable]public var message:String;
    [Bindable]public var message2:String;
    private function titleWindow_close(evt:CloseEvent):void {
    PopUpManager.removePopUp(this);
    private function submit_click():void {
    Alert.show(scenario_name.text, "Alert");
    new_scenario.send();
    PopUpManager.removePopUp(this);
    var win:Hello = PopUpManager.createPopUp(this,Hello, true)
    as Hello;
    PopUpManager.centerPopUp(win);
    private function reset_click():void {
    scenario_name.text = "";
    ]]>
    </mx:Script>
    <mx:HTTPService id="new_scenario" method="POST" url="
    http://localhost/simulator/scenario.php"
    useProxy="false">
    <mx:request xmlns="">
    <scenario_name>{scenario_name.text}</scenario_name>
    <message>{message}</message>
    <message2>{message2}</message2>
    </mx:request>
    </mx:HTTPService>
    <mx:Form>
    <mx:FormItem label="Scenario Name:">
    <mx:TextInput id="scenario_name"
    text=""
    maxChars="45" />
    </mx:FormItem>
    </mx:Form>
    <mx:ControlBar horizontalAlign="right">
    <mx:Button id="submit"
    label="Submit"
    click="submit_click();" />
    <mx:Button id="reset"
    label="Reset"
    click="reset_click();" />
    </mx:ControlBar>
    </mx:TitleWindow>

    Hi,
    I am trying to display some data on the Child window that
    would need to take the data from the parent titleWindow, which
    could be drop down menus, text labels or combo boxes. I would need
    to use a HTTPService on the child dialog box to accomplish task I
    think, but the problem is, how would I get the information from its
    parent window? The example I have are all about how the text input
    from the child window gets feed back to the parent.
    Would I need to create a "reverse" declaration or something
    so I can access the information from the parent in the child
    window?
    I hope this makes sense.
    Thanks for your help.
    Alice

Maybe you are looking for

  • How can I to obtain the value selected in a search help?

    Hi Gurus, I have a search help and it has a "search help exit" (a FM). At FM search help exit I am calling the standard FM RHF4_RFC_FIELD_VALUE_REQUEST to another system ( assigning the corresponding "destination" ). The FM RHF4_RFC_FIELD_VALUE_REQUE

  • Mac On Network Mounting At Startup

    Whenever I restart (or when the Finder relaunches-see previous post), one Mac on my network mounts on its own. I know in the OS 9 days, you could tell a volume to automount on restart, but I don't know if that's possible in OS X. I've scoured my star

  • Terms and condiditions for Spain exclude the use outside El Salvador

    The terms and conditons page for El Salvador and that for Spain seems to be the same. The problem is that for Spain it forbides the use outside El Salvador!: «El Servicio iTunes está disponible para usted sólo en EL Salvador. Usted acepta no utilizar

  • I can't configure the resolution on my 34460A DMM with IVI

    I'm trying to acquire data from my 34460A using IVI. When I use Configure Measurement, the DMM doesn't seem to be taking the resolution properly. It seems to be setting full range (slow) measurements no matter what I set there. I set the range to 3A

  • Blackberry 8830 & Oracle Connector?

    Hi, Has anyone else tried syncing the Verizon Blackberry 8830 with Oracle Connector for Outlook? I tried installed the BBDM patch from Oracle....but that only seems to work with BBDM 4.1. BBDM 4.2.2 is required for the 8830. Anyone have any workaroun