Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Java JFrames

Options
  • 04-05-2009 8:05pm
    #1
    Registered Users Posts: 302 ✭✭


    Hi, I am new to JFrames and would like some general advice. If I want to have a Login JFrame and a DoStuff JFrame, how do I get them to communicate. In the Login frame, I have a username, password, another text field and commit & quit JButtons, with an actionlistner added to the buttons. On the second frame I want to display the username and the contents of the other text field (basically a number of items of data from frame1). When the user commits on the login frame, I want to display the second frame which includes the data that was entered in the first, plus more enterable fields, and commit & quit JButtons.
    1) How many classes should I have, i.e. should I have a class per frame and a controlling class, and a class to represent the data, e.g. a pojo. What clases should implement the listeners.
    2) What listeners should I have for the 2 sets of buttons and how do I communicate betweens the frames, how do both frames reference the pojo.
    I am asking thes questions so that I can build a multi-frame application to a reasoble pattern.
    Any help appreciated.


Advertisement