Results 1 to 3 of 3
  1. #1
    Join Date
    May 2012
    Rep Power

    Question a new class for a frame


    I have created a new little project : a user has to choose if he wants the client which are entreprises or client which are simple clients ( particulars) to appear.
    He can choose selecting a client type with a radio button.

    If i use uml methodology, i only have to create two classes : the client class and the connection_database class.
    But i also need to create the class which permits the user to choose the client type he wants to appear: i have called it selection_clients_frame(graphic interface).

    Do you think my choice is coherent or not.
    If i create the graphic interface in the main class, i will have to implement the actionListener interface in the main class.
    Is it acceptable or not.
    Can you tell me what you think about all this and perhaps advice me.

    Thanks a lot.

    Best regards

  2. #2
    Bushman is offline Member
    Join Date
    Apr 2012
    Spainish TOwn
    Rep Power

    Default Re: a new class for a frame

    IF I understand correctly, you want your software to comprise of 2 screens:
    A.Client type selection
    B.Result Display of client type selection process (information extracted from a database wrt client type selected);

    And you have a database mechanism to extract data per client type, for the result display.

    All you need is 3 simple classes.
    A.A frame class
    B.A panel class that extends JPanel
    C.A class with the database functionalities

    Now, class C is clearly the class with the database functionalities,

    while class B would be an extension of JPanel, on which you would create the client selection screen(a panel) and the client results screen(another panel),
    where you could easily toggle between those panels via the setVisible ( Boolean ) method invoked for each panel.

    next we have the final class, the frame, which you will add class B to.

  3. #3
    Join Date
    May 2012
    Rep Power

    Default Re: a new class for a frame

    Hi and thanks a lot for your answer

    I don't well understand this sentence"next we have the final class, the frame, which you will add class B to. "

    In the client class, i have created a "display_clients" method which both
    - creates an instance of the connection_database class to connect the database
    -permits to display all the selected clients in a new frame.
    In the connection_database class , there are all the database connection fonctionnalities

    -In the clients_selection class i only propose a graphic interface to choose the selected client.
    -in the main class, i create a new instance of the clients_selection frame.
    Thanks a lot for telling me if the clients_selection frame can be a part of my project or not, because it is not a class created from the uml methodology(diagramm classes).

    Best regards.

    Last edited by curious_programmer; 05-08-2012 at 09:35 AM.

Similar Threads

  1. Draw multiple class objects in one frame
    By jj007 in forum AWT / Swing
    Replies: 2
    Last Post: 01-14-2012, 06:32 PM
  2. Replies: 11
    Last Post: 12-20-2011, 08:40 PM
  3. Close a frame from another class
    By aborgeld in forum New To Java
    Replies: 11
    Last Post: 03-27-2011, 08:22 PM
  4. Replies: 4
    Last Post: 01-18-2011, 08:22 AM
  5. 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

Posting Permissions

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