Results 1 to 2 of 2
  1. #1
    droidus is offline Senior Member
    Join Date
    Feb 2011
    Rep Power

    Default desiging program

    I am a bit confused. i am not sure how to design my project. i know all of the code, but not sure how it entirely fits together. for example, let's say i ask for user input. they put something in, and it is taken to a method. the method says "return this!". so the method returns it, and puts it in a text area. then the user has to put something else in. the text is taken back into the method, and so on. how do i tie in the gui with the methods that actually run the application? right now, my gui is a mix of swing and case statements, etc. :p one thing i was thinking, was to remotely (from the class that has all the methods that run the app.) update the text area, but it says that it doesn't exist (of course).


  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Rep Power

    Default Re: desiging program

    At the momoent you essentially have a controller (your non-gui stuff) and a view (your gui). There may be a model (your data), but that's not entirely relevant at the moment.

    Your controller's job is to react to events on the gui, so it should register listeners with the gui. The number and responsibilities of the listeners are entirely down to what your gui does (and is unlikely to be something easily covered here), and how you fancy coding it.

    Anyway, the gui will then inform the relevant listener when an event happens (button click, that sort of thing) that requires some data to either be processed by the controller or to be retrieved from the controller.

    If you still have case statements after that then there's probably something more basic up.

Similar Threads

  1. Replies: 2
    Last Post: 04-02-2011, 12:57 PM
  2. Replies: 13
    Last Post: 03-22-2011, 06:49 AM
  3. changing my program to array working program
    By Chewart in forum New To Java
    Replies: 39
    Last Post: 11-18-2009, 06:53 PM
  4. Replies: 0
    Last Post: 04-04-2008, 02:40 PM
  5. Replies: 0
    Last Post: 10-04-2007, 09:33 PM

Posting Permissions

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