Calling a method on a jFrame from a jPanel that created by the jFrame

Hi all
I can not for the life of me work out how to do this.
Calling a method on a jFrame from a jPanel that created by the jFrame.
I have used this code to set a handle for one jPanel to another.
i.e I can create new jpanel and pass in handles from one to another but not back to the jFrame.
// this is sudo code
  private Panel_Top topPanel;
  private Menu_Panel menuPanel;
  private DataPanel dataPanel;
//create new
    topPanel = new Panel_Top();
    menuPanel = new Menu_Panel();
    dataPanel = new DataPanel();
// add handles from one to another
    menuPanel.setDataPanel(dataPanel);
    topPanel.setDataPanel(dataPanel);
    topPanel.setMenu_Panel(menuPanel);
    dataPanel.setMenu_Panel(menuPanel);
// in each class I use this to set
  public void setDataPanel(DataPanel dataPanel) {
    this.dataPanel = dataPanel;
  }But I can not seam to get a handle back to the jFrame that created it.
Please help
as you can see I am trying but no luck so far
Thanks

class Life extends JPanel{
      pulic Life( JFrame owner )
            owner.doSomething(); // pass the JFrame to the constructor and feel free to use it
}[code[                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Is it possible to call a method in a servlet from  a java script ?

    I need to do a dynamic html page . In the page i select some things and then these things must communicate whit a servlet because the servlet will do some DB querys and update the same webpage.
    So is it possible to actually call a method of a servlet from a java script? i want to do something that looks like this page:
    http://www.hebdo.net/v5/search/search.asp?rubno=4000&cregion=1011&sid=69DHOTQ30307151
    So when u select something in the first list the secodn list automaticly updates.
    thank you very much

    You can
    1. load all the options when loading the page and
    set second selection options when user selected
    the first; or
    2. reload the page when user select first selection
    by 'onChange' event; or
    3. using iframe so you only need to reload part of
    the page.

  • Calling a method in BPM Object from jsf page

    Hi All,
    How do I call a method in BPM object from JSF page? Is it possible to invoke it in a manner similar to invoking a method from managed bean in JSF application?
    Please help.
    Thanks and Regards,
    Veronica

    You can use f:invoke (or f:invokea to with parameters)
    For ajax calls, you can use f:invokeUrl to get the URL to a particular method within your BPM object, although make sure the Server-Side Method property is set to Yes.
    http://download.oracle.com/docs/cd/E13154_01/bpm/docs65/taglib/index.html

  • Calling a method of one class from another withing the same package

    hi,
    i've some problem in calling a method of one class from another class within the same package.
    for eg. if in Package mypack. i'm having 2 files, f1 and f2. i would like to call a method of f2 from f1(f1 is a servlet) . i donno exactly how to instantiate the object for f2. can anybody please help me in this regard.
    Thank u in advance.
    Regards,
    Fazli

    This is what my exact problem.
    i've created a bean (DataBean) to access the database. i'm having a servlet program (ShopBook). now to check some details over there in the database from the servlet i'm in need to use a method in the DataBean.
    both ShopBook.java and DataBean.java lies in the package shoppack.
    in ShopBook i tried to instantiate the object to DataBean as
    DataBean db = new DataBean();
    it shows the compiler error, unable to resolve symbol DataBean.
    note:
    first i compiled DataBean.java, it got compiled perfectly and the class file resides inside the shoppack.
    when i'm trying to compile the ShopBook its telling this error.
    hope i'm clear in explaining my problem. can u please help me?
    thank u in advance.
    regards,
    Fazli

  • How to call main method in one class from another class

    Suppose i have a code like this
    class Demo
    public static void main(String args[])
    System.out.println("We are in First class");
    class Demo1
    public static void main(String args[])
    System.out.println("We are in second class");
    In the above program how to call main method in demo calss from Demo1 class......???????

    No, i dont know how to call other than main methods from other classes
    And one more doubt i have i.e. Like in C can we see the execution of the program like how the code is being compiled step by step and how the value of the variable changes from step to step like(Add Watch).........

  • Can I restore OSX to a disk,  from a backup that's on the same disk?

    I have a Powermac G5 Quad, that has two internal drives. (a 250gb system drive, and a 500gb spare).
    Both drives are now out of space. I want to purchase a 1TB drive to replace the 250 system drive.
    Tell me if this plan makes any sense:
    1. Remove the 500gb spare drive.
    2. Install the 1 TB drive, format, & use it as the Time Machine backup disk for the system drive.
    3. Once the backup is complete, Remove the 250gb system drive.
    4. Boot to the 10.5 Install DVD, and select "restore from backup"
    5. Use the Backup on the 1 TB Drive, to install the OS on the same disk.
    It's step # 5 that I'm not sure will work. Can I install an OS to a disk, from a backup that's on the same disk?

    Sorry it took me so long. I had a baby. Anyway, here's how it went down:
    I attempted to use the disk utility to "Clone" the original 250gb system disk to the new 1tb Hard drive.
    It did not work. Tried booting to the Leopard install disk, and doing it from there, no dice.
    So, I went ahead and created 2 partitions on the new 1TB disk. One I called "Time Machine" and it was 300 gigs. The other I called "New System Disk".
    I booted to the "Old" System disk, and set up Time Machine to back-up to the "Time Machine" partition. It took 5 hours to back up 250 gigs, but it worked.
    I then booted to the 10.5 Install DVD. one of the utilities you can use is "Install from Time Machine Backup" This worked. Took about 5 hours to copy everything to the new "New System Disk".
    When that was done, I removed the old system disk. It booted to the new system disk without any trouble.
    I was now stuck with a "Time Machine" partition that I did not want. It was EXTRAORDINARILY EASY to delete that partition, then re-size the other one so it took up the entire 1 Terabyte of available space.
    So, the answer to the question is: Yes, you can use Time Machine to restore to the same disk, provided that the disk is using two partitions.

  • How do I transfer music, videos to my iPhone from another computer that is not the one my iPhone syncs with

    How do I transfer music, videos to my iPhone from another computer that is not the one my iPhone syncs with.
    Thank You!

    Take a look at this -> Recovering your iTunes library from your iPod or iOS device
    Short version: iTunes will transfer the purchases made from the iTunes Store on your iPhoneh to your computer. It treats all other music and video syncing as a one-way street, to comply with copyright laws (wont sync stuff not purchased through iTunes from your iPhone to your computer).

  • When I burned an album that had pictures from 3 cameras that I rearranged the cd came out in camera order not my rearranged order.  Can this be fixed without manually changing the cd?

    When I burned an album that had pictures from 3 cameras that I rearranged the cd came out in camera order not my rearranged order.  Can this be fixed without manually changing the cd?

    No.
    How did you arrange the shots in iPhoto? In an album, manually?
    Then Photos Menu: Batch Change -> Set Title to Text "John's Birthday", for instance, and tick the box to append a number to each Photo. Now your photos are titled 'John's Birthday 001, John's Birthday 002 ... etc'
    Then File -> Export and in the Export dialogue set the Filename to "Use Title"
    Sort on Filename in the FInder and you end up with a folder full of images in the same order as the Album in iPhoto.
    Regards
    TD

  • How to call a method in one JSP from another JSP?

    say that I have 2 JSPs.
    JSP one has a button.
    JSP two has some method that, say, find the square root of the number passed from JPS one.
    How to - when click - the button on page one call the method on page two?
    Please note that I can not use object binding, but I want passing the actual parameter and call the method on page two.
    Please note that this is an update of a previous post on the same topic called "Object scope".
    Thank you all very much.

    No, i dont know how to call other than main methods from other classes
    And one more doubt i have i.e. Like in C can we see the execution of the program like how the code is being compiled step by step and how the value of the variable changes from step to step like(Add Watch).........

  • Calling A.method() which instanced B from Instance A, B is of another class

    I have a class that creates a window. In the process of adding a mouse listener to a pane of labels in that object I am not able to create and action on left click of the label due to not being able to access the method of the Calling class
    public class A
         A(){
         JPanel MainBar = new JPanel();
          B b = new B( this );
             b.setB(x, y, anArray );
    public void changeIcon( int xL, int yL, int ind )
                switch ( ind )
                    case 0:
                        if ( jlblButtons[xL][yL].getIcon() == icon[0] )
                            jlblButtons[xL][yL].setIcon( icon[1] );
                            ButtonPanel.repaint();
                           GroupClear instance_of_clear = new GroupClear();
                            instance_of_clear.groupClear( xL, yL, x, y );
    public class B
           public int[][] anArray;
           public int x;
           public int y;
              A e;
           B(A e){
                 this.e = e;
           public void setB(int x, int y, int[][] anArray )
               this.anArray = new int[x][y];
               this.anArray = anArray;
           public void mousePressed(MouseEvent e) {}
           public void mouseReleased(MouseEvent e) {}
           public void mouseClicked(MouseEvent e)
               String location = e.getComponent().getName();
               x = Trim.trim( Trim.Left( location, 2 ));
               y = Trim.trim( Trim.Right( location, 2 ));
               if ( e.getButton() == MouseEvent.BUTTON1 )
                   switch ( this.gameArray[x][y] )
                       case 0:
                          e.changeIcon( x, y, 0 );
                          return;
    }It calls the get Icon, but the compiler cannot find e.changeIcon
    I have also tried to send the calling class like this
    b.setB(x, y, anArray );
           public void setB(int x, int y, int[][] anArray, B e)
               this.anArray = new int[x][y];
               this.anArray = anArray;
                  this.e = e;
           }But to no avail. What will I need to do in order to properly call the function of the class that called B?
    Edited by: Stancoffyn on Nov 16, 2007 3:22 PM

    What exactly do you want to call and where?
    You can't call e.changeIcon() from mouseClicked because e is MouseEvent, and (in the second piece of code) you can't assign an instance of type B to a field of type A.

  • Calling a method in BPM Object from jsp page

    hi all,
    I try to call a method from BPM Object using <f:invokeUrl >
    I change server side method properties to yes.
    and then how can i get request and response object inside the BPM method.
    Thanks.

    Thanks for ur response,
    But i mention about BPM method inside BPM Object.
    i found this inside the documentation.
    methodName(Fuego.Net.HttpRequest request, Fuego.Net.HttpResponse response)
    i need to match above BPM method and <f:invokeUrl > tag. am i right?
    But i don't know how to create method with argument "Fuego.Net.HttpRequest request, Fuego.Net.HttpResponse response" inside BPM Object.
    I can't find any place to define method argument inside Oracle BPM studio.
    I don't know how to parse argument like "Fuego.Net.HttpRequest request, Fuego.Net.HttpResponse response"
    With Regards,
    Wai Phyo
    Edited by: user8729650 on Sep 9, 2009 7:03 PM
    Edited by: user8729650 on Sep 9, 2009 9:20 PM

  • Calling a method in a tab from the main window.

    I came into this project and I don't fully understand why I can't do what I want to do.
    The previous writer creates a main GUI that looks like a normal Windows Application with the menus and things. Then inside he has tabs to navigate to the various parts of the program where the user can input data and receive results. This I understand. He begins the program by using a starter to create a new MainGUI calling it MainGUI.  My problem is now that I am working on the tab and want to call one of MainGUI's get methods, I can't. I can call from another tab. EX: SitePropPanel.getOpenYear() where SitePropPanel is another tab that is created in the MainGUI.  When I try to use MainGUI.getData() it just says _MainGUI cannot be resolved.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    In case it is not clear, In the tab, I want to I want to be able to call a getter method that exists in the MainGUI. I thought I could do this by saying
    MainGUI.getData();  I used MainGUI because that is name the previous programmer gave to the instance of the class, MainGUI, in the Starter class.

  • Calling a method in Parent component from Title Window

    Hi all,
    I have a parent component that opens up a Title window when I
    click a button. Now I want to call a method in that parent
    component from the Title window. How do I do this in Flex? Could
    anyone give me a hint please.
    Thank you in advance for the help

    "happybrowndog" <[email protected]> wrote in
    message
    news:gctmql$4t5$[email protected]..
    > That's goddamned ridiculous. What were Flex developers
    thinking that you
    > have
    > to write a custom event to call back to a parent
    component?? Other GUI
    > libraries such as WxWidgets, Fox, Qt, Delphi, MFC,
    WinForms, etc., all
    > allow
    > you to either call via a reference to the parent object
    or submit a
    > callback
    > function into the child object. That's just basic OO
    programming. Flex
    > is
    > looking more and more ridiculous and more like Swing -
    tons of unnecessary
    > coding to do simple things.
    You absolutely _do_ have the capability to pass in a
    reference to the parent
    component, or to create a "hard" reference to
    Application.application. But
    these are not recommended practices, because anything you
    create this way is
    then tied to an environment that implements those properties
    and methods.
    Q (3): I want to run a function in my main application from
    inside my
    custom component. But when I try to refer to myFunction() in
    that
    component, I get a compile time error Call to a possibly
    undefined function
    myFunction. How can I fix this?
    A: Your component has its own scope, so it doesn't know
    anything
    about the functions in the main file. You can get around this
    by directly
    referencing the main application scope like this:
    Application.application.myFunction(). However, this makes
    your component
    tightly coupled, which is a quick way of saying that your
    component is only
    usable in an application that has a myFunction() function in
    it. You're
    better off dispatching an event from your component and
    letting the
    application decide how to handle it. For more information,
    check out the
    following resources:
    http://www.adobe.com/devnet/flex/articles/loose_coupling.html
    http://www.adobe.com/devnet/flex/articles/graduating_pt1.html
    From
    http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf

  • Call a method in VB dll from Java Web Application

    Hi,
    I'm trying to call a method of a VB dll, from a web application developing with J2EE. Is it possible without JNI? And, if it is not possible with a tool, can you help me with an example of JNI using?
    Thank you
    Mary

    maria_eg wrote:
    I'm trying to call a method of a VB dll, from a web application developing with J2EE. Is it possible without JNI? Maybe using Runtime#exec() and rundll32.exe. Depends on the DLL which you want to call.
    And, if it is not possible with a tool, can you help me with an example of JNI using?JNI tutorial: http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jni.html
    JNI forum: http://forum.java.sun.com/forum.jspa?forumID=52

  • Need call a method of one iview from another iview

    Hi,
    There are 2 iviews in a component.
    1) FirstView - contains abc() method & xyz() methods
    2) SecondView (a popup) - asdf() method
    i want to call abc() method from asdf() method. i.e. i want to call a method of the firstview from the secondview.
    Note:
    1) i couldn't able to copy the code of abc() method to component controller, as it has the code which uses (iview) local attributes (this can be done by context mapping) & main reason is from the method it calls the xyz() method of the same view (again i couldn't call a method of iview from component controller).
    2) firstView contain 5 tabs, i want to be in the same tab from which secondview (popup) was called, if i use fire plugs between both view, the current tab will be chnaged (i suppose, not sure).
    3) can we use event handlers, if yes how can we do that.
    Please provide a better solution for calling a method of view from another view.
    Thanks
    Maha
    Edited by: Maha Hussain on Jan 13, 2009 12:40 PM

    Hi Maha,
    It is better to have such methods in the component controller to make it reusable and avoid writing same code again and again.
    You can have that method in component controller and call that method on click on a button from Iview1 and can pass the parameters in the mthgod only.
    for example.
    Say Method abc() which is currently in Iview1 and you are passing values from context say aa bb cc to the method now what i am suggesting is
    have that method abc(String aa, String bb, String cc) ;
    and call it on click on button in Iview1 and pass the required parameters.
    Hope this will help
    Regards
    Narendra

Maybe you are looking for

  • Report spontaneously stops working

    I mentioned in yesterday's post that I cleared an error by re-implementing the page from scratch with the same SQL. The error has recurred, so I'm thinking now that I must be overrunning an internal buffer somewhere. Page 1 is my query-by-example for

  • Automate Customization of "Application customization class name" in BPM

    Hi, I am from BPM Process Accelerators team. We are trying to automate the "Process Accelerator" install process in DTE. As part of PA post install tasks, we have to add the value *"oracle.bpmpa.global.model.WorkspaceExternalApp"* against the *"Appli

  • Loading Modules and Mounting Local Filesystems failed during boot

    Hi all, since 2-3 weeks I've had some FAIL during the boot (after having upgraded the system, I remember that there was involved an upgrade of init script probably, or something connected with the booting process). [gianluca@gianluca-laptop ~]$ dmesg

  • How to execute a system command on a remote UNIX server?

    I would like to execute a system command (for example "df") on a remote UNIX machine. A simple example would be welcome... Thanks

  • PO Requisition Approval workFlow

    Hello All I am working on PO Requisition Approval work flow , when we crate a requisition one workflow is generated and my user want the workflow notification should be modified , like we have in the table few columns supplier ,itmes and wareshouse d