File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPanel

 
Justin Fox
Ranch Hand
Posts: 802
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok i have a "main" JPanel inside a JFrame, and I have two inner "little" JPanels, and when you click one it becomes enabled, and you can move it around with the directional keys..

is there a method to see if a jpanel is touching, or intersecting another, so you can do the move, test, then setBounds??

Justin
 
Craig Wood
Ranch Hand
Posts: 1535
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can make up methods to do these for you.
For intersection/collision:

For boundry–checking (staying within big JPanel):
 
Justin Fox
Ranch Hand
Posts: 802
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, ill try those out : )
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic