• Post Reply Bookmark Topic Watch Topic
  • New Topic

Movable connected objects on JPanel or Jframe

 
Samer Telawi
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dears,
I want to develop some application in which I need to drag and drop some rectangles (extends JPanel) and move them on another JPanel or JFrame and I need to connect them together with lines.
it is like designing class diagrams in UML software
choosing two objects for example and connect them together with a line and when moving one of them the line must be modified to keep the connection between two objects.
so would you please provide me with some code example for such case ... and if it is possible some algorithm to how manage and organize such connected objects and lines to show the graph in a well organized way
I am looking forward for your suggestions and help
with great appreciate
thanks
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Samer Telawi wrote:
so would you please provide me with some code example for such case ... and if it is possible some algorithm to how manage

Nope. Sorry. This is not how the things happen here at the Ranch.
Share with us, what you have tried, tell is where you are stuck and we will help point you in the right direction.

1) Do you know how to play with graphics? (from the swing perspective)
2) Do you know how to have your own custom painting? (Again from the swing perspective)
3) Do you know how to trap and process mouse events in a swing application?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!