Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swing Model View Presenter (MVP) example

Tags:

java

swing

I've been reading up on the MVP pattern, and have been unable to find a Java Swing code example. Does anyone know an opensource project that uses this pattern or where I could find such an example? (I'm not looking to use a framework to help implement the pattern, just an example.)

like image 227
LeviX Avatar asked Jan 05 '12 14:01

LeviX


1 Answers

Actually, from a certain point of view, all of Swing can be seen as a MVP model( It really is turtles all the way down).

Models:
  ListModel, TableModel, etc.
Presenter:
  All Swing widgets, such as JLabel, JTable, JPanel etc.
View:
  ListUI, PanelUI, LayoutManagers, etc.
 

I've written several systems using MVP with Swing, JSP, and GWT, and have been extremely happy with the results each time.

like image 126
Emily Crutcher Avatar answered Oct 09 '22 04:10

Emily Crutcher