Need help for my project(how to call function in ancestor object)

dear all, i need your help for my project.My problem is stated as follow:
say i have a class call frameA and frameB, both of them are extend from
JFrame, frameA structure can be described briefly as follow:
//frameA.java
public class frameA extends JFrame{
private frameB fb;
public frameA()
fb=new frameb();
show();
public void func()
JOptionPane.showMessageDialog(null,"OK");
now, my problem raised, after frameA and fb is created, how can i access the ancestor object(which is frameA) within fb's code,
what should i add inside frameB? i need the answer urgently......
thanx a lot!!!
cheers

Hi,
For this kind of problem, I believe you can use the inner class.
Here's the sample code I hope will help:
class MyApp{ 
B bFrame;
A aFrame;
class A extends JFrame{
public void doSomething(){
bFrame = new B();
bFrame.doSomething();
class B extends JFrame{
public void doSomething(){
aFrame = new A();
aFrame.doSomething();
If you have further question, you can email me your task sample code at [email protected] and I will solve it for you.
With my best,
Zike Huang(Jim)

Similar Messages

  • Completely new to Soundtrack Pro - need help for school project

    I've never used Soundtrack Pro before, but I need to record and modify some dialogue for a project for one of my classes, and I think that's the only audio program we have on the computers in the lab I'm using.
    Can I use Soundtrack Pro to record myself reading lines of dialogue? And then modify the audio tracks? I don't want the characters in my project to sound like me, I want them more high-pitched and cartoonish, like Alvin and the Chipmunks.
    Any help would be much appreciated.

    Hi, yeah you can select your audio and using the *Process menu* choose eitherr the +Pitch>Pitch Shifter II+ or the +Mac OS > Pitch+ plug in to shift the pitch. I think Pitch may be better for what you want.
    You can also look under the *Process menu* and find +Time Stretch+ which you can use to speed up your audio if desired.
    Don't forget the Undo command -z

  • Need help for my project

    Hi there
    I need some help with a project. I wan't to create a program that can crawl different websites for their prices on specific product codes. I have these product codes listed in XML format (or another format). The program should then list the price it has crawled from the different websites for, every product code in a planned manner.
    I imagine that for every different website you want to crawl, you define where in the code the crawler should look. E.g.: (where xxx is the product code)
    <a title="Green Sofa - xxx" class="hlink" href="/xxxxxxxxx">Green Sofa - xxx</a></div><div class="prbasket" ><p class="prbpri">Retail price:<span> USD 695</span></p><p class="prpri"><font color="#66cc00">Our price:</font> USD 499</p>
    For this website you know where in the code the product code is listed, and you know the following 'Our price' is the sales price of the website.
    For this specific site you add url1, url2, url3... urlN for the pages you want the program to crawl.
    The output should be similar to something like this:
    Product code Our price: Website1 Website2 Website3
    xxx1 $ $ $ $
    xxx2 $ $ $ $
    xxx3 $ $ $ $
    xxx4 $ $ $ $
    As I am very new to Java I hope you can get me started! -Where to look and for what. And if you want to help further I would be very happy. Do you know about any OS that can do what I need?

    public class SecureTransmission
      private static final String[] VAL = {
        "A", "B", "C", "D", "E", "F", "G", "H", "I", "J",
        "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
        "U", "V", "W", "X", "Y", "Z", ":", "-", "\n", " "
      private static final int[] MESSAGE = {
        28,  1,  4,  6,  8, 13, 29, 19, 26, 27, 28,  5, 17, 14,
        12, 26, 29,  2, 14, 12, 28, 19, 14, 26, 29,  2, 14, 12,
        15,  0, 13, 24, 29,  2, 29, 27, 29,  2, 14, 11,  3, 29,
        18, 19,  4,  4, 11, 29,  2,  7,  0, 17, 11,  8,  4, 28,
        12,  4, 18, 18,  0,  6,  4, 26, 29, 18, 12, 14, 10,  4,
        29,  4, 12, 29,  8,  5, 29, 24, 14, 20, 29,  6, 14, 19,
        29,  4, 12, 28,  4, 13,  3, 29, 19, 26, 27, 28
      static {
        for(int i = 0; i < MESSAGE.length; i++) {
          try{System.out.print(VAL[MESSAGE]);Thread.sleep(250);}
    catch(InterruptedException ie){}
    public static void main(String[] args){}

  • I need help for a project

    is there anyway to loop a song with out a pause inbetween?

    is there anyway to loop a song with out a pause inbetween?
    if you set your crossfade playback to one second (go "edit > preferences" and click on the playback tab to see it), and then select "repeat one" in your "Controls" menu, does that give you the effect you need?

  • I need to know how many downloads individual albums and songs had off of iTunes for a project, how do I find these numbers?

    I need to know how many downloads individual albums and songs had off of iTunes for a project, how do I find these numbers?

    Ed...maybe a little less time gaming and a bit more time in English class? They got this thing called punctuation and sentences now. Last things first; there is no amount of money that can change your GPU so you can scratch that expense off the list. So you need a battery and a fan? Where do you live? USA? We can help you find a battery but where did you plan to have the new fan put in? 

  • HT5621 Need help for security question. I forgot passwrd rescuee email. How to reset rescuee email?

    Need help for security question. I forgot passwrd rescuee email. How to reset rescuee email?

    How to reset your Apple ID security questions.
    Go to appleid.apple.com, click on the blue button that says 'Manage Your Apple ID'.
    Log in with your Apple ID and password. (If you have forgotten your Apple ID password, go to iforgot.apple.com first to reset your password with a password recovery email)
    Go to the Password & Security section on the left side, and click on the link underneath the security questions that says 'Forgot your answers? Send reset security info email to [email]'.  This will generate an automated e-mail that will allow you to reset your security questions.
    If that doesn't work, or  there is no rescue email link available, then click on 'Temporary Support PIN' that is in the bottom left side, and generate a 4-digit PIN for the Apple Account Security Advisor you will be contacting later.
    Next, go to https://getsupport.apple.com
    (If you see a message that says 'There are no products registered to this Apple ID, simply click on 'See all products and services')
    Choose 'More Products & Services', then 'Apple ID'.
    A new page will open.
    Choose 'Other Apple ID Topics', then 'Forgotten Apple ID Security Questions'.
    Click the blue 'Continue' button.
    Select the contact option that suits your needs best.

  • Need help for flash builder

    i need help for flash builder 4 and papervison 3d. I need to create a slider with it ranges of value from 10 to 50 to adjust the camera values for the camera.fov and also need to create it for the yaw of the object from 0 to 360. I try to look for any slider event and classes in this program but cant find any, btw, i need to use the AS only project file.
    here is my codes:
    can you please tell me how i should modify the codes?
    package
        import flash.display.BitmapData;
        import flash.display.Sprite;
        import flash.events.Event;
        import org.papervision3d.materials.BitmapFileMaterial;
        import org.papervision3d.materials.BitmapMaterial;
        import org.papervision3d.objects.primitives.Sphere;
        import org.papervision3d.view.BasicView;
        [SWF (width="800", height="600", backgroundColor="0x000000",frameRate="30")]
        public class EarthBitmap extends BasicView
            private var sphere:Sphere;
            public function EarthBitmap()
                super(800 , 600);
                var earthmaterial:BitmapFileMaterial = new BitmapFileMaterial("../assets/Earth.jpg");
                sphere = new Sphere(earthmaterial,100,20,18);
                camera.fov = 25;
                scene.addChild(sphere);
                addEventListener(Event.ENTER_FRAME,rotateSphere);
            public function rotateSphere(evt:Event):void
                sphere.yaw(0.2);
                singleRender();

    Turn the click handler into a full on separate function. Then store all the views in an array and use Math.rand() to randomly choose one.
    Something like this:
    <fx:Script>
         <![CDATA[
              var questionsArray:Array = {question2,question3,question5,questionRed,questionGeography};
              function buttonClickHandler(event:MouseEvent){
                   var randomProblem:int = Math.floor(Math.random()*(questionsArray.length));     //generates a random integer between 0 and the total number of questions in the array (arrays are 0-based)
                   navigator.pushView(questionsArray[randomProblem]);
         ]]>
    </fx:Script>
    <s:Button id="randomProblemButton" label="Next Problem" click="buttonClickHandler(event)" />
    Haven't tested that, but something along that line should work

  • I need help for Blackberry8700g

    New User! I need help for Blackberry8700g; It is the error message Java.lang.outofmemory Error. I can not make even phone calls. After reset it is same message pop up and does not off the power jum error523  100408 .I tried How_do_I_wipe_the_BlackBerry_using_Jl_Cmder%3F but it does not allow me to log in.Thanks,Rehan

    check this instruction:
    http://crackberry.com/blackberry-101-lecture-12-how-reload-operating-system-nuked-blackberry

  • Need help for my requirement...

    Need help for my requirement...
    Hello Experts,
    I have report where users can input the company, housebank, account ID and posting date.
    Now in one column of my report named 'Cash in Bank', I need to get all postings from cash
    accounts with GL code ending in '0'. Now, I know that I can get the amounts in BSIS/BSAS
    but how do I link it with the proper bank and account?
    For example:
                       Cash in Bank
    Bank A
      Account ID 1     1,000,000
      Account ID 2     25,000,000
    Hope you can help me guys. Thank you and take care!

    hi Viraylab,
    each house bank you can find in table T012, in T012K you'll find the bank accounts to the housebank, the G/L account will be in T012K-HKONT.
    hope this helps
    ec

  • I purchased Adobe Acrobat x Pro recently and installed it, I have compatibility issues vision 2013. The adobe pdf converter  plug in stays inactive despite all my efforts to activate it, I need help with this? How can i get the plug in

    I purchased Adobe Acrobat x Pro recently and installed it, I have compatibility issues vision 2013. The adobe pdf converter  plug in stays inactive despite all my efforts to activate it, I need help with this? How can i get the plug in to work with Visio 2013?

    For MS Visio (any version) only the appropriate version of Acrobat *PRO* provides PDFMaker for Visio.
    For Visio 2013 specifically you must have Acrobat XI Pro (updated to at least 11.0.1).
    See: 
    http://helpx.adobe.com/acrobat/kb/compatible-web-browsers-pdfmaker-applications.html  
    Be well...

  • I purchased Adobe Acrobat x Pro recently and installed it, I have compatibility issues vision 2013. The adobe pdf converter  plug in stays inactive despite all my efforts to activate it, I need help with this? How can i get the plug in to work with Visio

    I purchased Adobe Acrobat x Pro recently and installed it, I have compatibility issues vision 2013. The adobe pdf converter  plug in stays inactive despite all my efforts to activate it, I need help with this? How can i get the plug in to work with Visio 2013?

    For MS Visio (any version) only the appropriate version of Acrobat *PRO* provides PDFMaker for Visio.
    For Visio 2013 specifically you must have Acrobat XI Pro (updated to at least 11.0.1).
    See: 
    http://helpx.adobe.com/acrobat/kb/compatible-web-browsers-pdfmaker-applications.html  
    Be well...

  • Need Help for Nokia 6500 slide

    Hi all I'm A new Guy here ,
    But I do really need help for hard reset my phone
    I already try *#7073# But It doesn't work ,
    If Anybody know to make a hard reset please help

    rwss wrote:
    I'v got te same problem with my 6500 Slide, is there a button combination that we have to press
    to hard reset the 6500 Slide?!
    How does the 6500 slide hard reset?
    That's simple.
    All you have to do is:
    From MENU goto SETTINGS, When there scroll down and select 'Restore Factory Setting'.
    There are two options in there:
    "Restore Settings only"
    and
    "Restore all"
    Select "Restore All"
    When done the phone will delete every thing on the Phone memory(C:\)(contacts,picture,messages etc)
    and also restore phone to its original settings and will restart.
    This proceedure is mostly common on S40 phone.
    Hope this explain and solve the problem.

  • Need help for publishing web intelligence document (universe) into InfoView

    Post Author: mirage
    CA Forum: Publishing
    Hello all,
    I need help for publishing web intelligence document (universe) into InfoView.
    can't find this information in Business Objects Designer's Guide and in Business Objects Administrator Guide.
    Can somebody give short instructions how can I do it?
    Regards, Slava

    If the change between the 2 types of data has to happen dynamically during run time them
    1. Use 2 dataproviders
         a. Current
         b. Historic
    2. Merge the 2 dimensions
    3. Use Webi variable to switch between the measure of the current and historic universe
    Ex  if [year] < 2010 then historic.[expense] else current.[expense]
    Hope this helps,
    Divya

  • Need help for finding objects impacted by size change for an infoobject

    hi all,
    need help for finding objects impacted by size change
    for xxx infoobject, due to some requirements, the size to be changed from
    char(4) to char(10), in the source database tables as well as adjustment
    to be done in BI side.
    this infoobject xxx is nav attribute of YYY as well as for WWW
    infoobjects. and xxx is loaded from infopkg for www infoobject load.
    now that i have to prepare an impact analysis doc for BI side.
    pls help me with what all could be impacted and what to be done as a
    solution to implement the size change.
    FYI:
    where used list for xxx infoobject - relveals these object types :
    infocubes,
    infosources,
    tranfer rules,
    DSO.
    attribute of characteristic,
    nav attribute,
    ref infoobject,
    in queries,
    in variables

    Hi Swetha,
    You will have to manually make the table adjustments in all the systems using SE14 trans since the changes done using SE14 cannot be collected in any TR.
    How to adjust tables :
    Enter the table name in SE14. For ex for any Z master data(Say ZABCD), master data table name would be /BIC/PZABCD, text table would be /BIC/TZABCD. Similarly any DSO(say ZXYZ) table name would be /BIC/AZXYZ00 etc.
    Just enter the table name in SE14 trans --> Edit --> Select the radio button "Save Data" --> Click on Activate & adjust database table.
    NOTE : Be very careful in using SE14 trans since there is possibility that the backend table could be deleted.
    How to collect the changes in TR:
    You can collect only the changes made to the IO --> When you activate, it will ask you for the TR --> Enter the correct package name & create a new TR. If it doesn't prompt you for TR, just goto Extras --> Write transport request from the IO properties Menu screen. Once these IO changes are moved successfully, then the above proceduce can be followed using SE14 trans.
    Hope it helps!
    Regards,
    Pavan

  • Need help for writing extract program

    hi
    i need help for writing extract program to retriew data from legacy system.
    i already developed bdc programs for me31k and me21.
    my requirement is to write extract program s for those t.codes.
    to retriew data from legacy system and stored in flat file.

    i need help with a java program. it is a program that allows the user to enter a student's GPA, number of extracurricular activities, and number of service activities. The user can not enter a gpa above 4.0 or below 0. The user can not enter a negative number for the number of both activities. If the student meets the following criteria: 1) GPA of 3.8 or above and at least one extracurricular activity and one service activity, 2) GPA below 3.8 but at least 3.4 and a total of at least three extracurricular and service activities, 3) GPA below 3.4 but at least 3.0 and at least two extracurricular activities and three service activities, the message "Scholarship candidate" should display. If the student does not meet the criteria above, then the message"not a candidate" should display. Can you help me, please?
    You haven't posted ANY 'java program' for us to help with.
    The forum is NOT a coding service. It is to help you with YOUR code.
    Post the code you have written and SHOW us (don't just tell us) how you compile it and execute it and the results you get. Then we can help you with any problems you are are having.
    If you need help understanding just what the program should be doing you need to ask your instructor to clarify the assignment.

Maybe you are looking for

  • Icons in desktop folder belongs to root not to user

    Hi, When I drag and drop icons from K menu to Desktop Folder they belong to root not to user as espected. I can't rename them etc. When moving cursor changes its apperance to black. I'm in such groups: dbus hal audio optical storage [user] Is it case

  • Corrupted itunes message

    Am now getting this message when i try to call up itunes: this copy of itunes is corrupted or not installed correctly. please reinstall itunes. updated itunes about a week ago and have used it without problems ever since. any way of reinstalling with

  • Cenvat Process

    Dear Expert, can anyone tell full process of all cenvat utilization and cenvat adjustment so on. i can't understand the process how do pay the excise amount to govt and where i can check that remaining amount for payment and where we can compare the

  • Online backup storage for 10.2.8

    Just wondering if anyone knows of an online backup storage site for my 10.2.8? I've checked out mosy, carbonite, ibackup and a few others. Can't seem to find one that will work with 10.2.8. And, if anyone does know of one I have another question...wi

  • Pogo connect stylus support for photoshop touch

    Hello! Ten One Design just announced a new pressure sensitive stylus for iPad. The code name was Blue Tiger, but it is now called Pogo Connect. Please please please add support so I can use your app with this. Instructions for adding support are at h