Retrieving the parent container....

I am trying to access a class method from a class that extends JFrame from a JPanel.
This is how I have my containers nested:
JFrame (MainFrame) > JPanel (cardPanel) > JPanel (ticketForm)
My JFrame class (MainFrame) has a method that I need to access but I keep getting a ClassCast Exception when i do this in my ticketForm class:
int i = ((MainFrame) this.getParent().getParent()).theMethodToCall()
Is this the wrong way to do that???
Thanks for any help.

wow, i found that it takes this to get to the class i want:
System.out.println("CLASS 5: " + this.getParent().getParent().getParent().getParent().getParent().getClass());
Is there any shortcut to get to the the JFrame class?
I see there is a getRootPane() method... ill try that
Thanks again!

Similar Messages

  • I have mistakenly deleted a mail folder which I had created. Can't remember if it was located to 'iCloud' or 'On My Mac'. How can I retrieve the emails contained in this deleted folder? Your help will be immensely appreciated!

    I have mistakenly deleted a mail folder in which I had created. I can't remember if it was located to 'iCloud' or 'On My Mac'. How can I retrieve the emails contained in this deleted folder? Your help will be immensely appreciated!

    Yeah not a problem. It does seem though that if you did not have a Time Machine backup then you may not be able to recover the deleted folder :/ But for future reference to prevent any of this, a Time Machine backup is a great investment.
    What it does is create an entire backup of your computer anything from personal information down to the screen saver.
    What you first need is a new external hard drive (I would recommend a 1TB or higher just to prevent running out of space soon).
    after that, just plug in the drive to your computer.
    once it is plugged in, in the top right hand corner, close to the wi-fi symbol, you should see a symbol that looks like a clock with a backwards arrow around it.
    click on that and select "open time machine preferences"
    just turn the button to the "on" position, and select the backup drive and Time Machine does the rest
    very great tool

  • How to determine the Parent process information in Oracle BPMS 10g

    Hi ,
    I am trying to retrieve the parent process information given the instanceId and Process Id of an instance of a process from a different process.
    I am getting the instanceId of the instance in workspace using the Fuego.Papi.ProcessService and by creating the Filter.
    I tried using the ProcessInstance.parent but it needs to be instantiated using the instance details of my referred instance, which i am not able to do.
    Can some one shed some light on how to get the parent process details from the referred instance.
    Thanks,
    shravan.

    Hi,
    If you mean to increase the request timeout i.e the time when a request is submitted to the server and the response is sent by the server it can be done in httpd.conf file located in $OracleHome/Apache/Apache/conf directory.
    The attribute to be used for setting timeout is "Timeout". By default teh value is 600 seconds i.e 5 minutes.
    After making these changes , run command dcmctl updateConfig -ct OHS and restart the HTTP Server. Please note these commands need to be run only if the httpd.conf changes are done through text editor.
    Hope this helps.
    Smita

  • Get parent container size in renderer?

    Hi,
    I'm trying to add a variable number of same-sized Canvas
    squares to the HorizontalList below:
    <mx:HBox width="100%" height="50%" >
    <mx:HorizontalList height="100%" width="60%"
    dataProvider="{myData}"
    itemRenderer="renderers.Topic" >
    </mx:HorizontalList>
    <mx:Canvas height="100%" width="40%" >
    </mx:Canvas>
    </mx:HBox>
    I want the squares to be proportional such that as the app is
    resized, the squares also grow or shrink in size. My item renderer
    gets the size of the parent HorizontalList (via
    BaseListData.owner.width) in order to calculate the dimensions of
    each canvas square; as the app is resized, the size of the parent
    changes and my square's dimensions are recalculated. However, it
    seems that the size of the parent container isn't know until I
    render some content but I can't render content until I know the
    amount of real estate available in the parent. I missing something
    basic here, right?
    Thanks, Garry

    Turn it around. Instead of having the item renderer calculate
    its width based on it's parent's width, have the HorizontalList set
    the size of its children in updateDisplayList().

  • Float clearing for parent container - DW doesn't display

    When I use one of the methods of float clearing for a parent container that has other floated elements inside of it, it seems to work fine in FF and IE. But it never shows up properly in DW design view. Instead, it just continues to show the parent container as collapsed.
    Is there some setting in DW that I can change to make it display properly? It's difficult to really know what's going on when it displays like this.
    Thanks...
    -Jesse

    JesseLY wrote:
    Thanks, Osgood. Here's a link to a test page.
    http://www.jesseyoung.com/tests/float_test/
    It displays fine in FF and IE, but shows the outer container as collapsed in DW design view.
    -Jesse
    Hi Jesse
    Change overflow: auto; to overflow: hidden; on the 'wrapper' css as below. This method will only work in DW CS4 design view.
    If you have a previous version of DW then you'll need to use the <br style="clear: both;"> method in the code if you want to see the correct rendering in Design view (see below)
    #wrapper {
    border: 5px solid purple;
    padding: 10px;
    overflow: hidden;
    width: 700px;
    background-color: white;
    Insert the <br> after the last floated element (as below)
    </div><!-- end floatLeft -->
    <br style="clear: both;" />
    </div><!--end wrapper -->
    Incidentally you appear to have an 'unpaired' </div> tag at the end of the code .

  • How to find the parent package

    Hi,
    The problem I'm trying to solve is, given an instance of a SSIS package being executed, I need to find the GUID and execution id of the package that calls it. According to the API (https://msdn.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.package.aspx)
    the Package class
    has a property "Parent", which returns the instance of the container that contains the child package. In reality though, this doesn't seem to work. Here's what I did,
    1. Create a child package that simply has a script task which writes a line to a file for debugging purpose.
    2. Create a custom SSIS component in which the child package is called by the myPackage.Execute() method;
    3. Given the reference myPackage, try to print the parent container id through the FireInfo() method from IDTSComponents interface.
    What I got was an "reference not set to an object" error, which means the parent property is null. This leads me to wonder, when is the parent property set? Is it only set during the execution of the child package? I tried to access it both before
    and after executing the child package, and in both cases the value was null.
    My ultimate goal is to write the parent package id (and execution id) into the ssis log so as to easily trace the execution of packages. Another option to achieving this goal would be through passing values via parent package variables but that seems to
    be too clumsy. 
    Any help / suggestion is greatly appreciated.
    Regards,
    Amos

    I have done the same thing via different way. Let me tell you how
    Step 1: Create a log table
    CREATE TABLE [dbo].[ExecutionLog](
    [LogID] [int] IDENTITY(1,1) NOT NULL,
    [ParentLogID] [int] NULL,
    [Description] [varchar](50) NULL,
    [PackageName] [varchar](50) NOT NULL,
    [PackageGuid] [uniqueidentifier] NOT NULL,
    [MachineName] [varchar](50) NOT NULL,
    [ExecutionGuid] [uniqueidentifier] NOT NULL,
    [Operator] [varchar](50) NOT NULL,
    [StartTime] [datetime] NOT NULL,
    [EndTime] [datetime] NULL,
    [Status] [tinyint] NOT NULL,
    [FailureTask] [varchar](64) NULL,
    CONSTRAINT [PK_ExecutionLog] PRIMARY KEY CLUSTERED
    [LogID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO
    ALTER TABLE [dbo].[ExecutionLog] WITH CHECK ADD CONSTRAINT [FK_ExecutionLog_ExecutionLog] FOREIGN KEY([ParentLogID])
    REFERENCES [dbo].[ExecutionLog] ([LogID])
    GO
    ALTER TABLE [dbo].[ExecutionLog] CHECK CONSTRAINT [FK_ExecutionLog_ExecutionLog]
    GO
    Step 2: On every package Create three Execute SQL Task
     Execute SQL Task 1 :  On begin of package 
     Execute SQL Task 2  : After completion of all task
    Step 3: Now create two SP
    For EQT #1
    --Root-level nodes should have a null parent
    if @ParentLogID <= 0 set @ParentLogID = null
    --Insert the log record
    insert into dbo.ExecutionLog(
    ParentLogID
    ,Description
    ,PackageName
    ,PackageGuid
    ,MachineName
    ,ExecutionGuid
    ,Operator
    ,StartTime
    ,EndTime
    ,Status
    ,FailureTask
    ) values (
    @ParentLogID
    ,@Description
    ,@PackageName
    ,@PackageGuid
    ,@MachineName
    ,@ExecutionGuid
    ,@operator
    ,getdate()
    ,null
    ,0 --InProcess
    ,null
    set @logID = scope_identity()
    EQT #2 On End
    update dbo.ExecutionLog set
    EndTime = getdate() -
    ,Status = case
    when Status = 0 then 1 --Complete
    else Status
    end --case
    where
    LogID = @logID
    You can create similar SP for OnError if you want 
    Step 4: Now create two variables LogId & parentLogId Int default value 0
    Step 5: Step up parent package variable configuration for logId like below
    Step 6: Call these SP in respective execute SQL task
    Hope this will help
    Glad to help! Please remember to accept the answer if you found it helpful. It will be useful for future readers having same issue.
    My Profile on Microsoft ASP.NET forum

  • Accessing the parent element of  a tree node !

    Hi All,
    I’m building a tree application, in which the user has the option for creating a new node at any level he wants. But my problem is, If the user wants to create a node at the same level of the selected node, how do I retrieve the parent element? Can someone help me in this regard? I’ve done the following
    1)     Created a node “TreeNode” with the required attributes & the recursive node.
    2)     When the user clicks on any node, I am able to retrieve the selected element through recursive traversal (i.e. the instance of TreeNodeElement, say elmt)
    3)     I was able to retrieve the parent element through the function elmt.node().getParentElement(). But it returns an instance of IWDNodeElement, which does not have the recursive node. Ofcourse, I cannot typecast IWDNodeElement to “TreeNodeElement”.
    Then How do I retrieve the “TreeNodeElement” instance of the parent element? Someone please help…..!
    Thanks in Advance,
    Best Regards,
    Nibu.

    Hi Nibu,
    you should type as follows
    IPrivateRecursiveTree.ITreeNodeElement ele=(IPrivateRecursiveTree.ITreeNodeElement)selectedElement.node().getParentElement();
    this way you will get the Parent element of the current node.
    Rgds,
    Vilish
    P.S. If prob solved, consider reward points

  • How to Load an SWF into the Parent SWF

    Hi all,
    I have 3 SWFs.
    X.SWF - Parent application. Contains an empty movie clip for
    loading external swfs using loadClip() method.
    B.SWF - Has some text and pics. Gets loaded into the empty
    movieclip on X.SWF. Also has a button saying 'Load A.SWF'.
    A.SWF - Similar to B.SWF with a button saying 'Load B.SWF'.
    When I start the main application (X.SWF) and load B.SWF into
    it all is fine.
    But would like to click on the 'Load A.SWF' button on B.SWF
    and load A.SWF into X.SWF. And visa-vesa.
    The problem is I'm not able to refer to the parent container
    (X) from these child (A and B) SWFs.
    Is there any way to do this?
    Thanks

    First if you use
    Button.onPress=function(){
    this._parent.loadMovie();
    the movie try to load swf into B.swf because "this" mean the
    button.Try with more ._parent or just if you X.swf is into the one
    MovieClip in 1st stage _level0.SWF.loadMovie();.Also if you want to
    load the A,B.swf into the stage simultaneously just create two
    movieclips into the X.swf mcA and mcB and the path has gone to
    _level0.SWF.mcA.loadMovie("A.swf"); :)

  • Change components parent container (owner)...

    Hi,  I have two containers which basically have draggable panels inside(components). on a button click I would like the panel(component) to change the parent container.. example..
    container A has three panels(components) inside Panel1,Panel2,and Panel3. Once I click on a button in either one of the panels i want the Panel(component) to move to container B. So it is no longer in A , now it is in B.  How is this possible...
    also.. how do you make a panel dissapear...destroy it.. on button click ??

    Hi,
    to remove panel from conatiner A
    In Flex 3 say A.removechild(panel) Flex 4 A.removeElement(panel)
    to add panel in to Container B
    In Flex 3 say b.addchild(panel) Flex 4 B.addElement(panel)
    to disapper panel say panel.visible = false.
    to appear it again say panel.visible = true

  • How can I list all folders that contain files with a specific file extension? I want a list that shows the parent folders of all files with a .nef extension.

    not the total path to the folder containing the files but rather just a parent folder one level up of the files.
    So file.nef that's in folder 1 that's in folder 2 that's in folder 3... I just want to list folder 1, not 2 or 3 (unless they contain files themselves in their level)

    find $HOME -iname '*.nef' 2>/dev/null | awk -F '/'   'seen[$(NF-1)]++ == 0 { print $(NF-1) }'
    This will print just one occurrence of directory
    The 'find' command files ALL *.nef files under your home directory (aka Folder)
    The 2>/dev/null throws away any error messages from things like "permissions denied" on a protected file or directory
    The 'awk' command extracts the parent directory and keeps track of whether it has displayed that directory before
    -F '/' tells awk to split fields using the / character
    NF is an awk variable that contains the number of fields in the current record
    NF-1 specifies the parent directory field, as in the last field is the file name and minus one if the parent directory
    $(NF-1) extracts the parent directory
    seen[] is a context addressable array variable (I choose the name 'seen'). That means I can use text strings as lookup keys.  The array is dynamic, so the first time I reference an element, if it doesn't exist, it is created with a nul value.
    seen[$(NF-1)] accesses the array element associated with the parent directory.
    seen[$(NF-1)]++ The ++ increments the element stored in the array associated with the parent directory key AFTER the value has been fetched for processing.  That is to say the original value is preserved (short term) and the value in the array is incremented by 1 for the next time it is accessed.
    the == 0 compares the fetched value (which occurred before it was incremented) against 0.  The first time a unique parent directory is used to access the array, a new element will be created and its value will be returned as 0 for the seen[$(NF-1)] == 0 comparison.
    On the first usage of a unique parent directory the comparison will be TRUE, so the { print $(NF-1) } action will be performed.
    After the first use of a unique parent directory name, the seen[$(NF-1)] access will return a value greater than 0, so the comparison will be FALSE and thus the { print $(NF-1)] } action will NOT be performed.
    Thus we get just one unique parent directory name no matter how many *.nef files are found.  Of course you get only one unique name, even if there are several same named sub-directories but in different paths
    You could put this into an Automator workflow using the "Run Shell Script" actions.

  • I live in a home with two other people, and one housemate tried to sync up his content from iTunes and iCloud onto another housemate's new iPad. the iTunes library only contains my content. is there any way to retrieve the there person's iCloud?

    i live in a home with two other people, and one housemate tried to sync up his content from iTunes and iCloud onto another housemate's new iPad. the iTunes library only contains my content. is there any way to retrieve the other person's iCloud? Can they go out of my account? Their content is saved on their iPads, but can another iCloud be on the same home computer?

    The syncing of music is one way, computer to phone. See this helpful document from a fellow user. Credit goes to the author.
    https://discussions.apple.com/docs/DOC-3141

  • IFrame(child container) still visible after closing the title window(parent container)

    Hi All ,
    I have created a sample project using a link button which when clicked opens up an TitleWindow which has an iframe and a text area in a hbox
    When you execute the application ,
              Click the link button
              The Popup window opens up showing the title window with the close button
              Click the close button of the title window
              The Title window is removed and the iframe and the text area are not visible
    Do this a couple of times
    You can notice that the iframe is still visible even when the title window is closed
    Can someone explain me how this issue can be resolved and also explain me why the iframe(child container) is still visible when the title window(parent container) is not visible. 
    Main Application file
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
        width="100%" height="100%" creationPolicy="all"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical" creationComplete="init()"
        xmlns:containers="containers.*">
       <mx:Script>
       <![CDATA[
           import mx.managers.PopUpManager;
           import containers.PopUpBrowser;
           public function doRequest():void
                    var requestPopup:PopUpBrowser = PopUpManager.createPopUp(this, PopUpBrowser) as PopUpBrowser;
                    PopUpManager.addPopUp(requestPopup,this);
                    requestPopup.x = 220;
                    requestPopup.y = 50;
       ]]>
       </mx:Script>
       <mx:Text fontSize="14" fontWeight="bold" text="Click the link button below to open the Title Window" />
       <mx:Spacer height="100"/>
       <mx:LinkButton label="Click me" fontSize="16" fontWeight="bold" click="doRequest()"/>
    </mx:Application>
    PopUpBrowser.mxml Component
    <?xml version="1.0" encoding="utf-8"?>
    <mx:TitleWindow
        xmlns:mx="http://www.adobe.com/2006/mxml"
        close="removeMe()"
        showCloseButton="true"
        styleName="myTitleWindowStyle"
        width="850" height="500"
        title="Klout User Profile"
        paddingTop="1" paddingBottom="1"
        paddingLeft="1" paddingRight="1"
        xmlns:generic="com.serendio.voom.components.generic.*"
        xmlns:flexiframe="http://code.google.com/p/flex-iframe/"
        horizontalScrollPolicy="off"
        verticalScrollPolicy="off" >
        <mx:Script>
            <![CDATA[
                import mx.managers.PopUpManager;
                public function removeMe():void
                    PopUpManager.removePopUp(this);
            ]]>
        </mx:Script>
        <mx:HBox width="100%" height="100%">
        <flexiframe:IFrame source="http://www.google.com" id="iFrame" width="50%" height="100%"/>
        <mx:TextArea text="Open and close the title window few times and watch the iframe remain visible even when the title window is closed"
             fontSize="14" width="50%" height="80%"/>
        </mx:HBox>
    </mx:TitleWindow>
    Thanks,
    Ajantha

    Hey,
    This is working fine for me with the current 4.5 Flex, Firefox 3.6.12, IE8. On what browser you are getting this error.
    Thanks,
    Jayagopal.

  • How can i refer to the parent window of the window containing an applet ?

    Hi all,
    I m stuck up with something. I have a web page say 'page1' which has a link that opens up a popup window. This popup say 'page2' window has an applet. On clicking particular pins on the applet i need to
    direct page1 to another URL & close the popup window. i hv tried this code.
    URL url = new URL(applet.getCodeBase(), path);
    AppletContext appletcontext = applet.getAppletContext();
    appletcontext.showDocument(url, "content");
    JSObject win = JSObject.getWindow(applet);
    win.eval("alert(\"Do u wnat to close!\");");
    win.eval("window.close()");
    This code opens up another window on click of the pin, & shows an alert before closing the popup window. On using
    appletcontext.showDocument(url, "_parent"); or
    appletcontext.showDocument(url, "_top");
    The window containing applet gets refreshed with the URL but not page1.
    How can i refer so to page1 from the applet.

    You don't show your code for what parent or top are, but in an
    applet, you must stick with relative links. Once you have the
    appletcontext, use a relative path from there:
    In the snippet below, docName is a relative path, i.e. ../up/above
       * Displays the specified document in the Web browser.
       * @param docName String pathname of document to download from Webserver
       * @return void
      private void fetchDocument(String docName) {
         AppletContext ctx = getAppletContext();
         java.net.URL serverURL = getDocumentBase();
         java.net.URL codeURL   = getCodeBase();
         java.net.URL docURL = null;
         try {
            docURL = new java.net.URL(codeURL, docName);
         catch (java.net.MalformedURLException err) {
            System.out.println("unable to compute URL from (" + serverURL + ", " +
                               docName + ")");
         if(this.bDebug)
           System.out.println("Open document: " + docURL.toString());
         ctx.showDocument(docURL);
      }

  • How can i centre two side by side divs vertically so they both are in the centre of there parent /containing div?

    How can i centre two side by side divs vertically so they both are in the centre of there parent /containing div? One of the divs is larger than the other so i would want the smaller one to centre inside a parent div like so:
    Grey= parent/container (Width of both orange and red div)
    Orange= Div 1
    Red= Smaller div- centralised (hopefully)

    If you wanted to go completely "Not for IE8 or lower" and use some of the often overlooked viewport units, it could be very responsive to browser resizing...
    <!doctype html>
    <html lang="en-us">
    <head>
    <meta charset="utf-8">
    <title> VW, it's not just a car for Mac users...</title>
    <style>
         -moz-box-sizing:border-box;
         -webkit-box-sizing:border-box;
         box-sizing:border-box;
    #gray {
        background-color:gray;
        width:80vw;
        margin:0 auto;
        height:40vw;
        font-size:2vw;
    #red {
        width:50%;
        height:50%;
        background-color:red;
        margin-top:12.5%;
        float:left;
    #orange {
        background-color:orange;
        width:50%;
        height:100%;
        float:left;
    </style>
    <!--[if lt IE 9]>
    <link href="IE-only.css" rel="stylesheet" type="text/css">
    <![endif]-->
    </head>
    <body>
    <div id="gray">
        <div id="orange"></div>
        <div id="red"></div>
    </div>
    </body>
    </html>

  • How can we retrieve the name of the Parent Space from the subspace?

    We wish to use a hyperlink in a subspace template which allows a user to link back from the subspace to its parent space.
    This hyperlink should show the name of the parent space.
    These Expression Language Expressions return parent information, but they so not show the Name of the parent space or other details like the Parent Space URL.
    #{spaceContext.currentSpace.parent}
    #{spaceContext.space['bpo'].parent}
    How can we retrieve the name of the Parent Space?

    I agree!
    I can't top this approach.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

Maybe you are looking for