How do I synchronize GUI-Elements?

Posted by anonymous2500 on Stack Overflow See other posts from Stack Overflow or by anonymous2500
Published on 2010-05-14T13:41:45Z Indexed on 2010/05/14 13:44 UTC
Read the original article Hit count: 185

Filed under:
|
|

Hello, I have a little problem with my java-program. I wanna use Observer, to synchronize two GUIs. But I can't synchronize the JComponent / JButton elements. For example:

I have a GUI-Class which implements the Observer-Class:

public class GUI extends JFrame implements Observer

I have a second "GUI"-Class which extends the JButton-Class and makes changes on a specific Button-Element.

public class Karte extends JButton{
...
this.setEnabled(false);
...

How do I synchronize this Button via Observable? I have already tried to use "extends Observable" in this class, but the "setEnabled()" method is explicit for the JButton-Class, which is not Observable!

Can someone help?

Thanks.

© Stack Overflow or respective owner

Related posts about java

Related posts about observer