Results 1 to 2 of 2
Thread: Making a map program
- 12-05-2010, 09:52 PM #1
Member
- Join Date
- Dec 2010
- Posts
- 1
- Rep Power
- 0
Making a map program
Hey everyone, I've been trying to create a simple map program using different methods, but they have all fallen short.
What I'm trying to create is a map program in which an image is loaded and on top of this image buttons are placed on specified areas, so that when a user clicks these buttons, a pop-up box will be displayed with information about that area/building. I would like the image along with the overlaying buttons to be in a JScrollpane and I will be adding click and drag support so the scroll bars aren't the only way to navigate around the map. I'll be adding this scrollpane to a JFrame which will also have a panel that holds controls.
I've tried using a JLayeredPane to hold a panel with the image, and then add the buttons over it, but I can't seem to get the buttons to draw correctly. I've also tried using the OverlayLayout, but without much success.
I was wondering if anyone could point out a better technique of developing an application like this. Should I be using Java2D instead of the methods I've tried?
-
I don't think that you need to go to the trouble of using JLayeredPane or OverlayLayout as the image can be simply a JPanel's background image painted in a paintComponent override. I think layered panes are useful when dragging images or components on top of another, such as in a chess or checkers game, but your images are static and so this is not required.
Also, I would solve one issue at a time in isolation of the others though rather than trying to solve the whole thing in one big huge program.
Much luck!
Similar Threads
-
difficulty making java program, Help Me
By 3c4hy0 in forum New To JavaReplies: 11Last Post: 08-13-2010, 12:08 PM -
Need help making program more efficient
By cid in forum New To JavaReplies: 4Last Post: 06-30-2010, 07:22 PM -
Making the program
By pheonix in forum Advanced JavaReplies: 4Last Post: 04-18-2009, 06:36 AM -
Help Making a program not crash
By Lifeis2evil in forum New To JavaReplies: 2Last Post: 12-10-2008, 03:10 AM -
Need help with Java classes for making a program.
By TheDarkReverend in forum Advanced JavaReplies: 2Last Post: 11-28-2008, 04:50 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks