Results 1 to 8 of 8
  1. #1
    shizuka is offline Member
    Join Date
    Feb 2011
    Posts
    7
    Rep Power
    0

    Exclamation How to connect one frame to another

    please help me how to connect one frame to another frame :confused: .. I'm making payroll system with the the back-end of mysql ... well the error persist when I'm trying to connect A frame which has a jbutton to compute .. and B frame to generate result as well as to print the given result entered on Frame A .. i dunno how to connect both frame to form one frame .. so please help we need it ASAP .. :(

  2. #2
    NRitH is offline Senior Member
    Join Date
    Feb 2011
    Posts
    118
    Rep Power
    0

    Default

    Turn both frames into JPanels, and add them to third JPanel.

  3. #3
    shizuka is offline Member
    Join Date
    Feb 2011
    Posts
    7
    Rep Power
    0

    Default tnx

    tnx for the idea .. but we're already done with the GUI that was made in JFrame .. can you give me a 2nd opinion on that..? :confused:

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

    Default

    Quote Originally Posted by shizuka View Post
    tnx for the idea .. but we're already done with the GUI that was made in JFrame .. can you give me a 2nd opinion on that..? :confused:
    Since your question is very general, I can only give a very general answer: Objects inter-communication is no different with Swing GUI's as it is with other OOP programs. One class needs a reference to the other class and then needs to send messages (call public methods) on the other class. This is nothing more than basic programming. If you need specific help, you'll have to provide more details. Please see the link below on how to ask smart questions to find out just what details I'm talking about.

  5. #5
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    7

    Default

    i dunno how to connect both frame to form one frame
    Thats because you can't. A frame is a window. If you want 1 window, than make 1 window with 2 panels. If you want 2 windows, then make 2 frames. You can't have 2 and 1 of something at the same time.

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

    Default

    gack, I misread the question and thought that you were just trying to have communication from one window to another. If you are in fact trying to combine them to one window, all the above is correct: to fix bad design you must redesign, period. Make them JPanels as has been suggested.

  7. #7
    shizuka is offline Member
    Join Date
    Feb 2011
    Posts
    7
    Rep Power
    0

    Default

    ohhh i see.. both replies help me to determined what really is the problem to be solve. is it JFrame or JPanel .. sorry for the vague questions .. Y n.n

    now that i had the connection bet. Frame A to B .. can someone help me to know the codes for hiding frame A after it proceed to frame B ??? tnx.

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

Similar Threads

  1. Replies: 4
    Last Post: 01-18-2011, 08:22 AM
  2. how to open one frame to another frame
    By tukadiya in forum AWT / Swing
    Replies: 1
    Last Post: 12-20-2010, 08:27 PM
  3. Java slave Frame access to its owner main frame problem
    By cagdaseckin in forum New To Java
    Replies: 0
    Last Post: 12-10-2010, 10:40 AM
  4. Replies: 7
    Last Post: 11-02-2009, 06:31 PM
  5. I m unable to connect one frame 2 the other
    By ankitraghuvanshi in forum NetBeans
    Replies: 2
    Last Post: 10-23-2008, 02:24 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
  •