File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes JPanel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JPanel" Watch "JPanel" New topic
Author

JPanel

Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802
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


You down with OOP? Yeah you know me!
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
You can make up methods to do these for you.
For intersection/collision:

For boundry–checking (staying within big JPanel):
Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802
thanks, ill try those out : )
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JPanel
 
Similar Threads
JInternalFrame title bar
Obtaining Current Layout for JPanel
labels on swing components
JScrollPane
Jpanel inside another JPanel