Getting frustrated with this... please help...
I have implemented some sort of a drawing board that extends a JPanel. Drawing of nodes and lines is done there. The JPanel is inside a scrollpane, and it's size will increase/decrease - like the zooming functionality when the user tries to click the JPanel. I am already done with the zooming functionality. My problem now is on Panning (or move) functionality. I really don't have any idea how to do this. It's like when the user is in panning mode, he can drag the JPanel to display the viewport it wants in the scrollpane.
Two ways at least...
If you code your visible objects so they all place themselves according to a reference point (upperLeft ? ), then in pan mode you could move this reference point according to the dragging and do repaints as you go along.
You could place the panel extension inside a JScrollPane, detect mouse dragging (in pan mode) and scroll accordingly, but I have not tested that appoach yet.
Last Post: 12-12-2002, 07:07 AM
Last Post: 04-30-2001, 05:46 PM
Last Post: 02-20-2001, 07:55 PM
By Eric Scantlebury in forum VB Classic
Last Post: 09-25-2000, 11:39 AM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL