Results 1 to 8 of 8
  1. #1
    Lisyandi is offline Member
    Join Date
    Apr 2011
    Posts
    4
    Rep Power
    0

    Default Set enable Button (in main panel) from internal frame

    i have a java project, this the problem how to set button in main panel from internal frame ? Please help me..

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Details. You'll want to provide more information if we have any chance of helping you. Please read the link in my signature below on how to ask smart questions for suggestions on what we need.

  3. #3
    Lisyandi is offline Member
    Join Date
    Apr 2011
    Posts
    4
    Rep Power
    0

    Default



  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Since the main panel is creating the internal frame, I think that main panel ought to be responsible for any side effects it wishes to grant internal frame. I would give the internal frame a public void method, say called addButton1ActionListener(ActionListener listener) and in this method add the listener parameter as an ActionListener to button1. Then when the main panel creates the internal frame, it can call the above method passing an ActionListener that re-enables the two buttons that it holds. This way the internal frame doesn't have to have any knowledge about the containing main panel, and if the main panel changes and the needs of this action changes, you only have to change the main panel's code not the internal frame's code.

    If my reply is not clear, please ask. Also consider posting some of your pertinent code. The best code you could post would be a small compilable and runnable program that shows the problem and runs unaltered for us, an SSCCE.
    Last edited by Fubarable; 04-02-2011 at 03:15 PM.

  5. #5
    Lisyandi is offline Member
    Join Date
    Apr 2011
    Posts
    4
    Rep Power
    0

    Default

    can you give me example project? please...

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by Lisyandi View Post
    can you give me example project? please...
    This would require quite a bit of work -- and frankly it's much better that the work be yours as it is your project after all. Why not create the example project and then we can work with it here.

  7. #7
    Lisyandi is offline Member
    Join Date
    Apr 2011
    Posts
    4
    Rep Power
    0

    Default

    This the example Project
    Please fix it, Thanks before

  8. #8
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    The code posted does not conform to the SSCCE standard. For a greater chance of help, I suggest that you create a valid SSCCE, and post the actual SSCCE code here in the forum, not a link to a download site.

    Best of luck.

Similar Threads

  1. Please help : JSP enable/disable button
    By kalyana in forum New To Java
    Replies: 3
    Last Post: 03-24-2011, 06:06 PM
  2. Java slave Frame access to its owner main frame problem
    By cagdaseckin in forum New To Java
    Replies: 0
    Last Post: 12-10-2010, 11:40 AM
  3. is it possible to dock Internal-Frame?
    By newbiejava in forum AWT / Swing
    Replies: 2
    Last Post: 07-07-2010, 01:10 PM
  4. Getting internal frame out
    By rad in forum New To Java
    Replies: 8
    Last Post: 08-11-2008, 03:33 AM
  5. Internal Frame order and canvas Z Index
    By dazza-s in forum New To Java
    Replies: 3
    Last Post: 05-29-2008, 07:20 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
  •