Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to determine the JWindow location ?

 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to determine the JWindow location ?

I have JApplet, which contain a Canvas in BorderLayout.center. The canvas has mouse events. When I click a Point in the canvas, it will pop up a JWindow below&left that Point. The problem is how to determine the location the JWindow show up ?

I try setLocationRelativeTo(), it doesn't work.

Any help is welcome. Thanks
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm confused. You said how to determine where it will show up? To me that means you want to know the coordinates of the JWindow when it displays. On the other hand, you might mean that you want to control where the JWindow pops up meaning you want to specifcy the location instead of having it show at the point explained.

Can you clear this up?
 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gregg Bolinger:
you might mean that you want to control where the JWindow pops up meaning you want to specifcy the location instead of having it show at the point explained.


This is what I mean.

I am doing an interactive map. When mouse over a city in the map, a JWindow will pop up , its left&top point should be mouse clicking point.


Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic