-
Getting frustrated with this... please help...
Hi!
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.
Please Help...
-
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.
or
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.
eschew obfuscation
Similar Threads
-
Replies: 5
Last Post: 12-12-2002, 07:07 AM
-
Replies: 9
Last Post: 04-30-2001, 05:46 PM
-
Replies: 1
Last Post: 02-20-2001, 07:55 PM
-
By Eric Scantlebury in forum VB Classic
Replies: 4
Last Post: 09-25-2000, 11:39 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
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
|
Bookmarks