NetBeans MVC support?

Discussion in 'Java' started by Consty, Aug 3, 2007.

  1. Consty

    Consty Guest

    I'm curious how one deals with large GUI based Swing applications
    using NetBeans? Typically from my understanding you use a model-view-
    controller technique to separate it all to easily have Frames talk to
    other Frames and etc. From messing around in NetBeans it doesn't seem
    like you can do that. You can't change generated code either. The
    only way I could really seem to do it was to declare a reference to
    the other Frame I wanted and pass that into a constructor or just
    allocate it within the current frame and call setVisible(). This
    isn't the right way I believe and I'm sure there is a way around this
    or something I'm not seeing. I'm only interested in figuring out how
    to do it with NetBeans and not manually without NetBeans. I know you
    can write the code yourself without it. Thanks in advance!
     
    Consty, Aug 3, 2007
    #1
    1. Advertising

  2. Consty

    Eric Sosman Guest

    Consty wrote:
    > I'm curious how one deals with large GUI based Swing applications
    > using NetBeans? Typically from my understanding you use a model-view-
    > controller technique to separate it all to easily have Frames talk to
    > other Frames and etc. From messing around in NetBeans it doesn't seem
    > like you can do that. You can't change generated code either. The
    > only way I could really seem to do it was to declare a reference to
    > the other Frame I wanted and pass that into a constructor or just
    > allocate it within the current frame and call setVisible(). This
    > isn't the right way I believe and I'm sure there is a way around this
    > or something I'm not seeing. I'm only interested in figuring out how
    > to do it with NetBeans and not manually without NetBeans. I know you
    > can write the code yourself without it. Thanks in advance!


    Write your model class, and then specify an instance of it
    in the "model" field of the property sheet of the JWhatever.

    Two JFrames (or in Jeneral, two JWhats) usually shouldn't
    talk to each other anyhow. Instead, they should talk to the
    same model instance: frame F1 updates some value in the model,
    and F2 learns about it because it's listening for model changes.
    F2 never knows (nor should it need to know) that the change was
    caused by something F1 did; as far as F2 is concerned, the model
    might have decided to make the change on its own initiative,
    after a timer expired or something.

    --
    Eric Sosman
    lid
     
    Eric Sosman, Aug 3, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pimousse
    Replies:
    2
    Views:
    3,705
    Roedy Green
    Apr 21, 2004
  2. Ilias Lazaridis
    Replies:
    0
    Views:
    938
    Ilias Lazaridis
    Dec 12, 2004
  3. rmn190
    Replies:
    2
    Views:
    2,468
    Arne Vajhøj
    Jan 10, 2008
  4. Paulo
    Replies:
    3
    Views:
    508
    Peter Bromberg [C# MVP]
    Dec 4, 2008
  5. Crazy Cat
    Replies:
    1
    Views:
    722
    schepp
    Sep 3, 2009
Loading...

Share This Page