How to determine 'location' of a JToolBar?

I have a floatable JToolBar. By default, it would be added to BorderLayout.SOUTH. However, some users might drag it elsewhere. So, when the user closes my application, I want to 'remember' where the user dragged the toolbar (whether North, South, West, or East) so that the next time the user opens it, I add it in the same area where he last dragged it.

How do I know which "area" the JToolBar is?

[413 byte] By [astigmatika] at [2007-11-27 8:50:28]
# 1
jb.getLocationOnScreen()
dayanandabva at 2007-7-12 21:01:42 > top of Java-index,Desktop,Core GUI APIs...
# 2

Ok, I got it. This is my Jython code (I think everyone can figure this one out):

def show_toolbar_borderlayout_location(toolbar):

loc = toolbar.getLocation()

x, y, orientation = loc.x, loc.y, toolbar.getOrientation()

if x == 0 and y == 0:

if orientation == 0: print "North" # 0 orientation means horizontal

else: print "West"

elif x > y: print "East"

else: print "South"

astigmatika at 2007-7-12 21:01:42 > top of Java-index,Desktop,Core GUI APIs...