Results 1 to 3 of 3
- 02-28-2010, 05:08 PM #1
Member
- Join Date
- Feb 2010
- Posts
- 2
- Rep Power
- 0
inner class Mouse listener not working in MVC model
I'm using the Model View Controller design for a current project.
There is a grid (2D array) of JButtons that need a mouse listener adding to them, however when I have the mouse listener inside the controller it doesnt work (using a method called from the controller constructor that is in the view to add the listener to the grid).
Its the same way that I have added action listeners so I'm wondering if mouse listener's need to be added when the view is created.
If so how do you do that in the MVC design?
Cheers
-
I think it depends on how your code is set up, so perhaps there's no generic answer for this. Also, you don't really give me enough information to know exactly what you're doing (perhaps others can figure it out, but not me). You may wish to post an SSCCE for us to examine (please see the link).
Incidentally, why add a MouseListener to a JButton and not an ActionListener?Last edited by Fubarable; 02-28-2010 at 05:51 PM.
- 03-01-2010, 03:19 PM #3
Member
- Join Date
- Feb 2010
- Posts
- 2
- Rep Power
- 0
Similar Threads
-
Mouse Listener for mouse floating over object?
By Krooger in forum AWT / SwingReplies: 1Last Post: 11-18-2009, 04:34 AM -
change the delay between double click in mouse listener
By itaipee in forum AWT / SwingReplies: 6Last Post: 03-17-2009, 02:23 AM -
Menu item not working properly for mouse events
By Preethi in forum New To JavaReplies: 1Last Post: 09-23-2008, 08:56 AM -
Mouse dragg not working
By Preethi in forum AWT / SwingReplies: 1Last Post: 02-08-2008, 04:51 AM -
Tree with Listener not working when added to ScrollPane
By praveen.kb in forum AWT / SwingReplies: 2Last Post: 01-09-2008, 07:06 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks