binding swing components
I am developing an application & facing some problems.
In my main frame i added a toolbar & added four navigational buttons on toolbar
I have two internal frames and both internal frames contain jtable.
when both internal frames are open all the navigational buttons of toolbar
bind/attach to the jtable of internal frame which is active at that time.
please help me to resolve this.
The fact is not that this is supposed to be 'Advanded Java', the fact is that you have probably never written any software where more objects, instantiated from different classes, had to communicate with each other (*).
Originally Posted by furqankhan
Swing JComponents are ordinary objects with one little addition: they can be seen on the screen as rectangular areas but they are ordinary objects nevertheless. If you want to 'talk to' an object or manipulate it you need at least a reference to that object. In your case: the buttons on your toolbar need a reference to the table they have to manipulate.
There is no magic involved with those visual components, they are ordinary objects and you should treat them as such.
(*) so no single main( ... ) method with all the code crammed in it.