Results 1 to 2 of 2
Thread: desiging program
- 01-23-2012, 07:04 PM #1
Senior Member
- Join Date
- Feb 2011
- Posts
- 235
- Rep Power
- 3
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).
thanks.
- 01-24-2012, 09:36 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,476
- Rep Power
- 16
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
-
How to code a program to send messages to a chat program?
By josh2992 in forum New To JavaReplies: 2Last Post: 04-02-2011, 12:57 PM -
How would I open a program from a single button of another program. Help...
By decgaid06 in forum New To JavaReplies: 13Last Post: 03-22-2011, 06:49 AM -
changing my program to array working program
By Chewart in forum New To JavaReplies: 39Last Post: 11-18-2009, 06:53 PM -
How to execute an External Program through Java program
By Java Tip in forum java.ioReplies: 0Last Post: 04-04-2008, 02:40 PM -
How to execute an External Program through Java program
By JavaBean in forum Java TipReplies: 0Last Post: 10-04-2007, 09:33 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks