How can I change a var in class C from class B if C and B are created in A?

Hi!
I have a little problem. It´s not really a Swing problem as you may believe by reading below, it´s about object creation.
I have a JFrame class called TransactionDialog. The TransactionDialog contains a JPanel with a CardLayout.
The CardLayout contains two components:
1) JPanelStep1 (an own class that extends JPanel)
2) JPanelStep2 (an own class that extends JPanel)
I want a variable in JPanelStep2 to depend on what the user does in JPanelStep1.
The question:
Both the JPanelStep1 and JPanelStep2 objects are created in the TransactionDialog class. How can I call the JPanelStep2 object (which is created in TransactionDialog ) from JPanelStep1 if JPanelStep1 has to be created before JPanelStep2 in the TransactionDialog class?

Jacobs has the right idea.
If this variable is part of the SWING display, you can do it the quick and easy way by passing that display object to JPanelStep1 and allowing that panel to mutate the value.
For instance:
JPanelStep1 step1 = new JPanelStep1();
JPanelStep2 step2 = new JPanelStep2();
step1.setDependent(step2.getDependent());
And the methods would be for example:
void setDependent(JTextField field) {
this.field = field;
JTextField getDependent() {
return field;
And whenever the user interacts with JPanelStep1 and you want to alter the text as it displays in JPanelStep2 you just make a call in JPanelStep1 to:
field.setText(updatedText);
Do not forget though that if you do not have your MDT squared away, the update might not occur immediately, without calling to your JFrame or throwing a thread on the MDT with invokeAndWait()

Similar Messages

  • How can i change my e-mail address color from blue to black when i send a new message

    How can i change my e-mail address color from blue to black when i send a new message

    Hi Steven, if you send to yourself does it come through blue?
    Is this in the Header or a Signature?

  • How can I change an app's Apple ID from one that no longer exist to a current one?

    how can I change an app's Apple ID from one that no longer exist to a current one?

    vanesanesa wrote:
    how can I change an app's Apple ID from one that no longer exist to a current one?
    Apple IDs generally don't stop existing. If you mean that you have changed your email address, what you need to do is update your Apple ID to the new email.  Start here:
    https://www.apple.com/support/appleid/manage/

  • I was in a Pages Doc and inadvertently had the Caps Lock on. How Can I change all the text I typed from Upper Case to Lower Case?

    I was in a Pages Doc and inadvertently had the Caps Lock on. How Can I change all the text I typed from Upper Case to Lower Case?

    Several protocols may be used.
    Here I describe two of them.
    (1) the one which I use : install and use the "Convert to Lowercase" service available in the free WordService
    (2) copy your text, paste in TextEdit and enter the Edit menu.
    I guess that you will recognize the items in your English menu.
    I apologize but I don't know the English items.
    Yvan KOENIG (VALLAURIS, France) jeudi 16 février 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.3
    My Box account  is : http://www.box.com/s/00qnssoyeq2xvc22ra4k

  • How can I change the location for the backup from iphone to itunes?

    How can I change the location for the backup from iphone to itunes? I want to backup to my external harddisk and not the computer itself. How do I do it?

    Moving the iOS device backup location
    Open a command prompt by hitting the start button and typing CMD<Enter> in the search box that opens up, or with Start > Run on older Windows.
    To move the current backup folder from C: to D: (for example) type in this command and press <Enter>
    Move "C:\Users\<User>\AppData\Local\Apple Computer\MobileSync\Backup" "D:\Backup"
    Where <User> is your Windows user name.
    To make iTunes look for the data in the new location type in this command and press <Enter>
    MkLink /J "C:\Users\<User>\AppData\Local\Apple Computer\MobileSync\Backup" "D:\Backup"
    If your preferred drive has a different letter or you already have a folder called "Backup" then edit "D:\Backup" accordingly in both commands.
    If you have Windows XP then you'll need a third-party tool such as Junction to link the two locations together instead of the MkLink command. The source folder is C:\Documents and Settings\<User>\Application Data\Apple Computer\MobileSync\Backup
    tt2

  • HOW CAN I CHANGE THE IDIOM OF PHOTOSHOP CC?, MINE IS IN SPANISH AND I WANT IT IN ENGLISH

    HOW CAN I CHANGE THE IDIOM OF PHOTOSHOP CC?, MINE IS IN SPANISH AND I WANT IT IN ENGLISH

    Change the language preference in the CC app settings and reinstall the program.
    Mylenium

  • How can I change CO-PA characteristic's validation from no check to check ?

    I created customer characteristic as no check in validation and applied it to
    operating concerns.
    Now I want to change it's validation from no check to check table.
    How can I change CO-PA characteristic's validation from no check to check table?

    You have to check this when u are creating the characteristics. After the charateristics is created and activated it may not be possible for you  to change it to NOCHECK mode.

  • My ipad is syncing notes to an old phone with a different apple id how can I change it to sync to the new iphone icloud is off and so is home sharing

    my ipad is syncing notes to an old phone with a different apple id how can I change it to sync to the new iphone icloud is off and so is home sharing

    Apps and Music are not from iCloud. Are from iTunes and App Store.
    You can change this from: Settings>iTunes and App Stores>Sign out and sign in with new ID, but you will have to pay again to download apps that you already have in your old account. Or leave it as it is to share purchases with your son.

  • I have used the resume tablet and put my resume into format but when emailing it, it will not open on windows. How can I change the format to where they will be able to open and view it?

    I have used the resume tablet and put my resume into format but when emailing it, it will not open on windows. How can I change the format to where they will be able to open and view it?

    I guess you mean one of the resume templates.
    What "format" have you saved your finished resume in?
    The only formats a Windows user will be able to open are .doc (Word), .pdf and rtf. The 1st 2 are usually the best.
    There is no Windows version of Pages.
    Peter

  • My Apple ID changed back to an old ID when I installed last update on my iPhone 5s.  How can I change it back to match what is on my MacBook Pro and iPad?

    My Apple ID changed back to an old ID when I installed last update on my iPhone 5s.  How can I change it back to match what is on my MacBook Pro and iPad?

    Hi GlendaGirl,
    Thanks for visiting Apple Support Communities.
    It sounds like you're unexpectedly seeing the incorrect Apple ID on your iPhone 5s. You can use these steps to sign out of iCloud on your iPhone 5s and sign in with the right Apple ID:
    iOS 6 and later: Go to Settings > iCloud.
    If you're still signed in with your previous Apple ID:
    Scroll down and tap Delete Account [Sign Out in iOS 8.] Depending on what iCloud options are turned on, you'll be asked to confirm that you want to delete data from your device. To confirm, tap Delete. (If you're using iOS 7 and have Find My iPhone turned on, you'll be asked to enter the password for your previous Apple ID. Enter the password, then tap Turn Off.) The data will be deleted from your device, but not from iCloud.
    Enter your current Apple ID to sign in. The data from your iCloud account will download again to your device.
    From:
    Apple ID: What to do after you change your Apple ID - Apple Support
    Best Regards,
    Jeremy

  • How can i change my security questions but i dont have a rescue email and my ipad is locked now for 8 hour?

    how can i change my security questions but i dont have a rescue email and my ipad is locked now for 8 hour?

    Alternatives for Help Resetting Security Questions and Rescue Mail
         1. Apple ID- All about Apple ID security questions.
         2. Rescue email address and how to reset Apple ID security questions
         3. Apple ID- Contacting Apple for help with Apple ID account security.
         4. Fill out and submit this form. Select the topic, Account Security.
         5.  Call Apple Customer Service: Contacting Apple for support in your
              country and ask to speak to Account Security.
    How to Manage your Apple ID: Manage My Apple ID

  • How can I change the app store location?Want to buy in us and it keeps saying I'm in the australia app store

    How can I change a app store location? I'm in US trying to dowload an app and it says my account is not valid in the Australian store. I have nothing to do with Australia.

    Go to the iTunes Store. Scroll down to the very bottom and click the flag that is on the bottom right. Then you can select what store you want.

  • How can i change my icloud email address? i mis typed my name and wanted to change my icloud email address??, how can i change my icloud email address? i mis typed my name and wanted to change my icloud email address??

    hello guys ...i need any help or suggestions, how can i change my icloud email address?? i typed a w rong name by mistake?? can i change it and retype the correct one? thanks ...your suggestio is higly appreciated.

    That's definitely not supposed to happen.  You shouldn't have someone else's iCloud email linked to your ID.
    You'll have to get iCloud support to sort this one out.  The only way to contact them is to start here: http://www.apple.com/support/icloud/.  You'll have to provide your iPhone serial number.  Unless it's within the 90 day free support window, or you purchased AppleCare, there will be a charge.  I suppose you can plead your case when they answer that you shouldn't be charged as you didn't set up this address and it shouldn't have happened with your ID.

  • My wife collected my online ordered iphone 6 when i was away and she entered a wrong email address as the Apple ID .How can i change it now since the IClould pops up asking for password and i can't provide it so could not even delet it .Helps !

    A wrong email address was entered at the setting up of the new iphone 6 and how can I change it ?

    The problem is she entered an email address she thought might be mine ,but actually used by someone else .She said no password was set up .My understanding is an email must have been sent to that address and he or she can set up the password and download .And now I set up an new ID under the ICloud but still the wrong email address still appear as a default one .I tried to delete the set up but I was asked for the password which we don't have .
    Any good idea ?

  • How can I change the color of all folders from light blue to another color?

    My computer was just upgraded from Tiger to Leopard, and now all the file folder icons are pale blue on the desktop and elsewhere. My desktop is green and those light blue folders do not look good on a green background.
    How can I change the color of the folder icons to another color?

    Hi ys,
    You appear to have taken a wrong turn on the information highway and would up in the backwater known as the AppleWorks forum. This is a place for discussion of issues and techniques connected with the now discontinued Apple productivity application AppleWorks.
    Yours is a System question, concerned with how to accomplish something in the Finder, part of the Mac OS X software you recently upgraded. The question will be better served in the Mac OS X v10.5 Leopard section of discussions. The link will take you to that section, where I'd suggest using the Finder and Dock forum.
    Regards,
    Barry

Maybe you are looking for

  • My MacBook Pro does not boot

    Dear forum I need some support. I have upgraded my MacBook Pro 2.2 to Leopard. Defined a Vista 32 Home Premium (original) Bootcamp partition. Everything has worked fine till yesterday. Now there is no way to boot the sistem anymore. If you select Mac

  • How I do to open a website created with iWeb in other computer

    Hi, My web site was created with iWeb last year in other computer, a dead MacBook. I have a copy of my web files created with iWeb, and moved to my new computer, iMac. Now I want to edit my web using iWeb, but I can´t find the way to open the files t

  • IPhoto seems to be missing few Photos features

    I was hoping iPhoto can fully replace built-in Photos app, but alas, that doesn't seem to be the case. Some of the most glaring omissions seems to be: Cannot delete photos (what is the point of hiding photos if I cannot delete them all later?) Cannot

  • Checkbox in the title of JTabbedPane

    How can I add a check box to the title of the JTabbedPane, so that I can check-uncheck these tabs. Or is there a workaround/anothe idea that will allow me to have similar functionality. TIA, - Manish

  • How to make new Firefox look like old Firefox?

    I was looking at the new version of Firefox and really don't like how it looks. If I update to it is there a way to make Firefox look like the old one? 3.6.24 is the version I'm using now, and I really like how it looks.