Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Custom controls or not?

 
Chaz Branham
Ranch Hand
Posts: 53
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

This is my first post here and glad to see there is a forum like this out there. I hope I can make sense in what I am trying to understand/do and any guidance and help offered is greatly appreciated. I have been programming for almost 12 years now but in other launguages and am now programming little tools in java to do certain tasks. Java is so vast I hardly know where to start but here goes.

I am trying to find any information on creating an object that has connection points on it (eg. would be like power point objects) where you can draw lines to or from it. So think of a rectangle/Jlabel that has four connection points that you could draw from or too connecting other jlabels together in some fashion. This really could be done with any type of object I would imagine but I do not understand java's way of integrating or modifying existing objects in this manner visually or functionality wise.

If you as a java programmer needed to produce something like the above would you create a custom control or possibly just extend a control or what? I just need a place to start if anyone has a few seconds to point me in the right direction I would greatly appreacite it.

Thanks
 
Maneesh Godbole
Saloon Keeper
Posts: 11070
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Way I look at things, this can be done in (minimum) two ways.
One would be to roll out your own solution. You can paint your own shapes, identify nodes, connect those nodes using lines etc. More on how to do this here http://docs.oracle.com/javase/tutorial/uiswing/painting/
Second would be to use something ready made like http://www.jgraph.com/jgraph.html or any other java graphing libraries.
 
Chaz Branham
Ranch Hand
Posts: 53
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so very much for the information. This is exactly what I was looking for! If anyone else has good examples then please continue to post but I am marking the thread as resolved as it does answer my question YAH! WOOT! lol
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic