Results 1 to 4 of 4

Thread: Where to put it

  1. #1
    Dipke is offline Member
    Join Date
    Aug 2010
    Location
    Leuven, Belgium
    Posts
    86
    Rep Power
    0

    Default Where to put it

    Hi,

    I have a poject list
    Java Code:
    List <Project> p;
    that i have to use everywhere in the program.
    Also at the actionPerfomed of buttons.
    Where do i have to put this List in order to acces him from actionPerformed and others ?

    Kind regards

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    12,999
    Blog Entries
    7
    Rep Power
    19

    Default

    Quote Originally Posted by Dipke View Post
    Hi,

    I have a poject list
    Java Code:
    List <Project> p;
    that i have to use everywhere in the program.
    Also at the actionPerfomed of buttons.
    Where do i have to put this List in order to acces him from actionPerformed and others ?
    Maybe you can make it a (private) member variable so everything in that class can access it?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Dipke is offline Member
    Join Date
    Aug 2010
    Location
    Leuven, Belgium
    Posts
    86
    Rep Power
    0

    Default

    Yes, but them i have to put the projects in the class with the panel.
    Is there a possibility to put them in an other place that is always available other then the GUI ?

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

    Default

    If your GUI uses a Model-View-Controller (MVC) structure, then the List will go in the Model. If you're not familiar with this structure, you might want to look it up (Wikipedia has a decent article on it).

Tags for this Thread

Posting Permissions

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