Results 1 to 4 of 4
Thread: MVC event classes
- 02-27-2012, 12:13 AM #1
MVC event classes
I'm about to design the largest Swing app I've ever written, and I'm studying the MVC design pattern.
Is it generally recommended to use standard event classes such as PropertyChangeEvent, or is it common to develop your own event class hierarchy?Get in the habit of using standard Java naming conventions!
-
Re: MVC event classes
I don't know the canonical answer to this, but I do know that there is a SwingPropertyChangeSupport built specifically for Swing apps that ensures that listeners are all notified on the EDT.
- 02-27-2012, 10:53 PM #3
Re: MVC event classes
Hmm. If I understand this correctly, say I have a JPA Entity class modeling some data, and a Swing component displaying it. The Swing component would register a PropertyChangeListener on a SwingPropertyChangeSupport object, and the Entity class (or its enclosing logic) could fire events on that SwingPropertyChangeSupport to update the UI. Right?
If it seems like I'm going about this backwards, it's because my app is primarily not UI-driven. Most of the UI updates will be triggered by data changes, which themselves will be triggered by parsing a data stream from a game server.Get in the habit of using standard Java naming conventions!
-
Re: MVC event classes
The GUI could listen to the model for data changes and then extract the changes when they occur.
Similar Threads
-
Classes Help!!! two classes with object question.
By stuckonjava in forum New To JavaReplies: 16Last Post: 02-10-2012, 01:39 AM -
Use classes inside of other classes
By BlankFile in forum New To JavaReplies: 2Last Post: 02-06-2012, 01:51 PM -
Event Handling with Separate Classes
By newbie123 in forum New To JavaReplies: 9Last Post: 05-26-2011, 05:12 AM -
event handling between classes
By newbie123 in forum New To JavaReplies: 3Last Post: 03-25-2010, 12:38 PM -
checking for an event during an event
By infinity in forum AWT / SwingReplies: 22Last Post: 04-09-2009, 01:08 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks