Results 1 to 2 of 2
  1. #1
    furqankhan is offline Member
    Join Date
    Jun 2010
    Posts
    1
    Rep Power
    0

    Default 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.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,771
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by furqankhan View Post
    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 (*).

    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.

    kind regards,

    Jos

    (*) so no single main( ... ) method with all the code crammed in it.

Similar Threads

  1. Problem In Swing Components
    By SANDY_INDIA in forum AWT / Swing
    Replies: 1
    Last Post: 07-19-2008, 11:23 PM
  2. Swing Components Placing
    By ne2000 in forum Eclipse
    Replies: 2
    Last Post: 06-23-2008, 09:00 AM
  3. How to print Swing components
    By Java Tip in forum java.awt
    Replies: 0
    Last Post: 06-23-2008, 12:04 AM
  4. Tab order on swing components
    By ashvin@projectdemo.biz in forum AWT / Swing
    Replies: 1
    Last Post: 05-31-2008, 11:06 AM
  5. Where is it best to declare swing components?
    By MacNstuff in forum AWT / Swing
    Replies: 1
    Last Post: 02-06-2008, 01:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •