From: Ken A. <kan...@bb...> - 2004-08-16 21:31:05
|
There are several concerns you must deal with when developing a Java GUI: - layout - where components go. - action - what happens when you click on something. - model - what happens to the underlying data "model" when an action happens. - update - what happens to the gui when an action happens. - enable - which actions are currently enabled. I've enclosed a slice of code that i'm using in an application tries to separate these concerns: - layout is delarative, like XUL http://luxor-xul.sourceforge.net/ it could be in xml. Layout show relative position of components and associates a named action and enabling state with each component. Any action occurs in its own thread. - model - the model is a simple prototype object which includes named components of the GUI. - update - Any update occurs in an invokeLater One way this differs from the Mode-View-Controller pattern is that i'm using a single update procedure. So i need to think about that more ... k |