Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JComboBox in one window updating a JButton in another window



"email@hidden" <email@hidden> wrote:

>I get no compile or runtime errors and I am able to call
>System.out.println("Message"); in my JButton constructor. So I know
>that my JComboBox object is talking to my JButton constructor, but
>nothing happens to acutely update my JButton. I am missing something
>when it comes to a JComboBox in one window updating a JButton in
>another window.

If a JComboBox is "talking to [a] JButton constructor", then it must be
creating a new JButton, rather than updating an existing one. It may be
replacing one JButton with another one, but that's not the same thing as
updating the text of a JButton that already exists, and has already been
added to some JPanel component hierarchy.

Are you sure you're adding the new JButton to the correct JPanel?

Is the JPanel holding the JButton visible or hidden at the time it's being
"updated" with the new JButton?

Without seeing the relevant code and how it all interconnects, I'm afraid
the best we can do is guess.

-- GG
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.