Results 1 to 3 of 3
- 01-27-2009, 12:33 AM #1
Member
- Join Date
- Jan 2009
- Posts
- 9
- Rep Power
- 0
Best way to do a pop-up 'info bubble'
this is my first post so hi to everybody :)
I'm making a Java applet which reads XML data and displays it on a JPanel. There can be several hundred to several thousand points (each point is a GPS position from a cycle ride, I have a screenshot but unfortunately I haven't posted enough to put it in the message). The route is plotted as a graph-like line, and when the mouse is moved over the route, the point underneath is selected and is highlighted in orange.
My intention is to have a bubble pop up as the mouse selects different points, showing details of that point (speed etc), but I'm not sure what would be the best way to create these 'info-bubbles'.
I could draw the bubble as 2D geometry directly on the same JPanel as the route, or I could create a child JPanel to hold it. Does anyone know what are the advantages of each approach, or perhaps there's a better method altogether?
thanks in advance for any suggestions!
- 01-27-2009, 07:17 AM #2
I would go with overriding getToolTipText for the JPanel.
Recommended reading:
How to Use Tool Tips (The Java™ Tutorials > Creating a GUI with JFC/Swing > Using Swing Components)
db
- 01-27-2009, 07:39 AM #3
Member
- Join Date
- Jan 2009
- Posts
- 9
- Rep Power
- 0
Thanks for the suggestion. Tool tips could work, however I really want to have a bit more control - e.g. multi-line text, images / graphics, and also I want the messages to be 'sticky' i.e. to stay 'popped up' until the mouse moves onto another point.
I will definitely use that tool tip class, so thanks again for the pointer, but for the info-bubbles - which are to be more like the bubbles on Google maps - I need something a bit more flexible.
Similar Threads
-
How to change Bubble+Selection+Insertion Sorts to Sort String Values?
By VinceGuad in forum New To JavaReplies: 3Last Post: 01-26-2009, 12:20 AM -
Trouble w/ Bubble Sort
By bri1547 in forum New To JavaReplies: 4Last Post: 08-01-2008, 04:41 PM -
How to sort a list using Bubble sort algorithm
By Java Tip in forum AlgorithmsReplies: 3Last Post: 04-29-2008, 08:04 PM -
Bubble Sort in Java
By Java Tip in forum AlgorithmsReplies: 0Last Post: 04-15-2008, 07:42 PM -
need help with bubble sort
By lowpro in forum New To JavaReplies: 3Last Post: 12-17-2007, 05:27 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks