Calling MDI parent from Internal Frame

Hello,
I have an InternalFrame that needs to access methods contained within its MDI parent window. So far, to acheive this, I can only think of creating a method within the InternalFrame that accepts the MDI instance (see below). Is there a better way to do this?
Thanks in advance for your input!
PG
class MDIParent
InternalFrame internalFrame = new InternalFrame();
internalFrame.setParent(this);
class InternalFrame
public void setParent(MDIParent instance)
mdiParent = instance;
// now I can call methods in MDIParent using variable 'mdiParent'
}

Hi
Yes you can call an internalFrame from an other
make sure when you run your application to make visible only
one internalFrame (let say internalFrame1) and the other ones to visible(false)
...........jInternalFrame1.setVisible(true);
...........jInternalFrame2.setVisible(false);
...........jInternalFrame3.setVisible(false);
...........jInternalFrame4.setVisible(false);
(Because all the jInternalFrames are initialy activated or iconifyed and you can not navigate
through them programatically.)
from there in jInternalFrame1 you add an event to call an other jinternalFrame
...........jInternalFrame1.setVisible(false); // if you want to come back from jInternalFrame2
...........jInternalFrame2.setVisible(true);
there you will see the internal frame visible
I had the same problems before.
Hope this will help you.

Similar Messages

  • Dipsose frame from internal frame

    Hi,
    I want to dispose the desktoppane through its internal frame. Need some inputs on this.. A java swings newbie

    ok, thanks ...
    But ok here is my issue when the user has logged in from the internal frame he is authorized then after which i want the menubar in the desktopane to change how can i do that

  • Premium subscription - calling the US from Interna...

    Can I use Skype to call the US from Bahrain with the premium subscription?

    No. You can't call to any landline or cellphone with Skype Premium.
    The product is for Skype-to-Skype video Group calling.
    http://www.skype.com/intl/en/prices/premium/
    TIME ZONE - US EASTERN. LOCATION - PHILADELPHIA, PA, USA.
    I recommend that you always run the latest Skype version: Windows & Mac
    If my advice helped to fix your issue please mark it as a solution to help others.
    Please note that I generally don't respond to unsolicited Private Messages. Thank you.

  • Control of NotifyIcon in MDI Parent from MDI child (C# Express)

    I have an MDI application with a base(Parent) form (FormA) and several child forms (Form1, Form2, etc). My Parent Form (FormA) is invisible and contains a ContextMenuStrip (contextMenuStrip1) and a NotifyIcon (notifyIcon1). I have 3 Icons defined in my properties.resources
    (a yellow, green, and red check mark). I start FormA from Main() in my Program.cs with  Application.Run(new FormA()); . FormA starts and checks various things via code in FormA or in Program.cs, selects the proper icon and sets it, may or may not
    create a message balloon depending on what it finds and gives the user access to the ContextMenuStrip by right-clicking the Icon. From the ContextMenuStrip the user can select the various other forms to make certain adjustments. Whichever form is selected
    by the user is started with:
    Form1 newMDIChild = new Form1();
                // Set the Parent Form of the Child window.
                newMDIChild.MdiParent = this.MdiParent;
                // Display the new form.
                newMDIChild.Show();
    Form1 (or Form2 or Form97) starts, checks stuff via routines in Form1 (or 2 or 97) and Program.cs and allows the user to change certain things via  textboxes or run certain routines via buttons that are made visible if appropriate. This all works flawlessly
    and I'm happier than a pig in you know what BUT... what I NEED to be able to do is change the Icon in FormA (notifyIcon1.Icon) from a yellow or red check mark to a green one, once things causing a problem are corrected while still remaining in Form1 (and/or
    2 and/or 97) to allow other changes to be made. My understanding was that Form Papa = (Form)this.MdiParent; would give me the Parent (FormA) form, but no matter what I have tried, I cannot change notifyIcon1.Icon, so there is an obvious disconnect in
    my thinking.
    Please understand that I am new at C#. The last time I "mastered" a programming language was in the days of Clipper 5.3 and C (DOS) when OOL was in its' infancy, so my toes got damp but my feet never got truly wet with OOL, so please type slowly
    Please understand also that I Understand that MDI is the personification of Satan himself here on Earth, but it is what for now I am stuck with and must solve. If you know better ways of accomplishing what I have described, by all means please point me to
    them for future use. I am learning, and will continue to learn until about two weeks after they wrap me in burlap with some heavy stones and drop me off a ship at sea.
    My thanks in advance for your patience, understanding and help.
    Dan

    Hello Dan,
    >>Form1 newMDIChild = new Form1();
                // Set the Parent Form of the Child window.
                newMDIChild.MdiParent = this.MdiParent;
                // Display the new form.
                newMDIChild.Show();<<
    1. First, I will point that if you called that MDI form with that way, you will not be able to access main form's instance, since you set its mdiparent to the
    main form's parent. So I would recommend you change it to the following one.
    newMDIChild.MdiParent = this;
    If you don't want the main form is mdi container, you could add a property to mdi form and pass the instance directly to that property instead.
    2. You could add the following property to the main form class.
    public Icon MyIcon
    get { return this.notifyIcon1.Icon; }
    set { this.notifyIcon1.Icon = value; }
    And then inside the MDI form, change that property to the one you want to change the icon to, e.g change it to Icon2.
    private void button1_Click(object sender, EventArgs e)
    Form1 f1 = (Form1)this.MdiParent;
    f1.MyIcon = Properties.Resources.Icon2;
    Result:
    Regard,
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • J-InternalFrame - calling a new frame from a internal frame

    hey..
    currently i have a internal frame that automatically starts up. now i have a button within that frame that is going to open another frame.
    if ("server_settings".equals(e.getActionCommand()))
          ALICE_InternalFrame.createServerSettings();
        }it tells me that i can not reference a non static method from a static one..
    how do i make a frame

    you probably have something like this
    class Whatever
      public static void main(String[] args)
        //some swing code
        doSomething();//<--errors here
      public void doSomething()
    }if so, instead use the constructor
    class Whatever
      public Whatever()
        //some swing code
        doSomething();//<--errors here
      public static void main(String[] args)
        new Whatever();
      public void doSomething()
    }

  • How to display internal frame on click event from another internal frame

    hi me developing desktop application in netbean. i have some problem. plz reply me as soon as possible. feedback me on [email protected]
    1. I want to invoke an Internal Frame by click event that is in another internal frame. how i do it. I tried my best
    2. how can i call reports (ireports) from swing application

    Read the JInternalFrame API. You will find a link to the Swing tutorial on "How to Use Internal Frames" which contains a working example.

  • Visibilty of Internal frame in a parent JFrame when it maximize

    i'm working projects on GUI MDI Form.So i've a problem that when we maximize the internal frame
    it should go back to Menu bar of parent frame MDI or title bar of perent frame MDI. Minimisable button and maxim button and closed button should be appear on the back of component where'r the internal going .
    means we can operate the internal frame minimise and close.
    So if anyone who worked on that please help me..............................................

    Without SSCCE, we can't help you!

  • How can I use internal frames with buttons to call others internal frames?

    Hello.
    I'm building a MDI-application using JFrames and several JInternalFrames, but I have problems.
    A JFrame has JMenuBar with JMenu and JMenuItem. One of these, call the first JInternal that has its interface. In this interface has a button that call other type (a class extension of JInternalFrame) JInternalFrame.
    When I clicked button happen a exception (java.lang.NullPointer).
    What happening?
    Help me, please.

    What i usually do is to give my desktop to my internal frames. So within the internalframe, you can use your desktop and add other internal frames to it.
    The code should look something like the following.
    desktop = your JDesktopPane
    MyInternalFrame = an InternalFrame
    AnotherMyInternalFrame = another InternalFrame
    public class MyInternalFrame extends JInternalFrame implements ActionListener
      private JButton jb = new JButton("Launch");
      private JLayeredPane desktop = null;
      public MyInternalFrame(JLayeredPane desktop)
        this.desktop = desktop;
        getContentPane().add(jb);
        jb.addActionListener(this);
      public void actionPerformed(ActionEvent ae)
        if (ae.getSource() == jb)
          desktop.add(new AnotherMyInternalFrame(desktop),JLayeredPane.DEFAULT_LAYER);
    }

  • Passing data from a Table in a Dialog to a Listbox in a Internal Frame

    Hi All,
    Currently I have 2 .java classes.
    In the first class, DisplayListBox.java, it would have listboxes in it and a textbox with a button, Find.
    Upon clicking on the "Find" button, it would create a dialog window and call the second class, TableSelection.java.
    Therefore now, the dialog window would contain a table with all the datas.
    Just in case you guys would like to know, the dialog window was created in the DisplayListBox.java class and the internal frame was being created in another cls upon clicking the menu btn.
    Upon selecting a cell in the table, i'd like to pass the value to the listbox in the internal frame, how can i go about doing it?
    I've got the coding for getting the value of a selected cells. However, i'm unsure of how i can pass the value retrieved to the listbox in the internal frame.
    Any help and advices are gladly appreciated! (:

    Thanks for your reply.
    However, I am quite new to java so is it possible for you to explain in details of how i should go about going it?
    To start off, could you tell me:
    1. Where do I create the ListSelectionListener? In the DisplayListBox.java or TableSelection.java?
    Sorry for the trouble but i just picked up java so I am pretty much unsure of all these stuff.
    Thanks for your help! (:

  • URGENT help for calling a window from a flash button in a frame not working

    Hello, i'm really desperated, because i can't call a window
    in a frame from flash with the getURL, i tried other but do
    nothing! and something of external something doesn't work too, so
    please can enya tellme what can i do???? i'm using flash 8
    professional, explorer 6, (and let me tell you that i didn't have
    issues before)!!

    chen1 wrote:
    > Hello, i'm really desperated, because i can't call a
    window in a frame from
    > flash with the getURL, i tried other but do nothing! and
    something of external
    > something doesn't work too, so please can enya tellme
    what can i do???? i'm
    > using flash 8 professional, explorer 6, (and let me tell
    you that i didn't have
    > issues before)!!
    Please search the forum, in past weeks I personally replied
    to the very same topic
    few times.
    Search for "Flash Player 9 - broken getURL doesn't open
    specified frame"
    and "Problems with flash navigation in Internet Explorer 7"
    Best Regards
    Urami
    !!!!!!! Merry Christmas !!!!!!!
    Happy New Year
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • How do you call a method from  another class without extending as a parent?

    How do you call a method from another class without extending it as a parent? Is this possible?

    Why don't you just create an instance of the class?
    Car c = new Car();
    c.drive("fast");The drive method is in the car class, but as long as the method is public, you can use it anywhere.
    Is that what you were asking or am I totally misunderstanding your question?
    Jen

  • GetURL:javascript blocked when called from a frame action in flash?

    Hi,
    I'm wrapping a load of flash/html eLearning content into air
    packages - or at least I was!
    The content is really old - flash 6 - and part of how it
    works is once it has loaded, it calls a javascript function, via a
    frame action. Each eLearning module relies on this call getting
    made...
    Sadly, this javascript call is never received - and having
    done a test it is purely down to the call being from a frame rather
    than a button (or other user interaction).
    eg. a movie with 10 frames. frame 10 has this action:
    (remember this is flash 6!)
    stop();
    getURL("javascript:foo());
    foo is never called.
    But put a button in with:
    on(release){
    getURL("javascript:foo());
    that works fine. Same call, but via a button.
    So really the question is - with air (or even is it something
    in new flash security?) - is there some reason why a frame action
    cannot call javascript? And if so - is there a parameter that can
    be set (like allowScriptAccess type thing - although tried that!)
    that will allow it again? Basically with over 1000 different flash
    movies, I'm not really in a position to re-code (eg.
    ExternalInterface does work! But can't recode 1000 movies to use
    that!).
    I've searched and can't see anything saying specifically a
    frame action call to javascript will be ignored, but clearly it
    is...
    Any idea, anyone?
    Thanks.

    You are calling the script while the mouse button is still
    down-- a
    hijacking truck.
    While it still works in older/unpatched IE, Microsoft has
    disabled
    resizeBy/To and moveBy/To while the mouse button is down.
    Obviously, when
    you have to click the Alert dialog's OK button, the mouse is
    no longer down.
    You'll need to take a different approach.

  • What's a dialog called that slides up from the frame?

    I need a popup dialog that alerts the user when a system value changes. I don't want to give this popup focus - the focus needs to stay in the window the user is currently editing.
    It seems like a perfect solution would be a panel that slides up from the frame and hovers for a few seconds before sliding back down.
    What are these properly called?
    Does anyone know of a freeware library or code snippet that illustrates how to implement them?
    Thanks! LegoQueen

    I need a popup dialog that alerts the user when a
    system value changes. I don't want to give this
    popup focus - the focus needs to stay in the window
    the user is currently editing.
    It seems like a perfect solution would be a panel
    that slides up from the frame and hovers for a few
    seconds before sliding back down.
    What are these properly called?I don't think there's an official name for these things, but popup dialog/window is pretty common. The sliding effect would make it a "sliding popup dialog".
    Does anyone know of a freeware library or code
    snippet that illustrates how to implement them?I do not, but they shouldn't be too hard to implement.
    Just have a separate thread running to change it's location at a certain speed. If you use a panel, you can add it to the drag level of the JLayeredPane of the JFrame. Shouldn't be too hard, but don't know of any examples.

  • UCCX 8.5 Grab full ANI from internal caller

    Hello,
    I'm trying to think of a way to grab the full 10 digit ANI from internal callers to my call centers for one of my scripts. I am not having any luck with this manipulation.
    Julius

    Is the extension defined as 10 digits, or something else? If something else then you would need to do some kind of lookup against XML/DB to prefix the digits based on the internal extension if there is relationship.
    HTH,
    Chris

  • Barred from international calls

    I'm currently barred from international calls on my iPhone 5c, I'm abroad right now so can't even call customer services to get it fixed. Any help?

    I've recently returned from France and I discovered that you need to have both international roaming and international premium calls enabled before you can use your phone abroad.
    Do you have access to the Internet either through mobile data or WiFi?
    Also, what network are you with (Orange, T-Mobile or 4GEE)?

Maybe you are looking for

  • Checking against Select-Options with "CP" using "IF value IN select_option"

    Dear experts, first of all: I'm sorry, if this question already should have been asked and answered! I tried quite a lot of search terms but didn't find anything helpful. We are using a statement like "IF value IN select_option" to perform comparison

  • Application doesnt start, problem event name : BEX

    I downloaded this app however, on launching it says it has stopped working with details pasted below. I have tried to put it under the list to exclude from DEP, but it doesnt allow it saying this program must run with DEP enabled I have tried to even

  • Macbook Pro DHCP issue

    We have one Macbook Pro user here who is on our Windows AD network (using his own machine unfortunately) but experiencing problems. We have reserved an IP address to facilitate internet access\firewall rules, however whenever the user initiates any p

  • Bootup time for 2012 MBP?

    Needs some help in deciding whether to upgrade to SSD or not. I know for a fact SSD will speed up bootup time incredibly.  How much difference in bootup time we are talking about here? My friend recently got a MBP (5400rpm HD) running Mountain Lion a

  • I'm trying to get a screen shot

    I trying to get a screen shot using the commandshift4, but after I do that I just get like a checkerboard pattern, when I check the picture. How can I fix it?