0

I'm making a simulator in Java and I have a plugboard where I have to connect two components of the plugboard with a wire. I was thinking to make the plugboard where each connector to be plug is a JLabel with an ImageIcon. What I don't know how to do is that connection, is there a simple way to link two components in java and to know which components are connected to each other and to make the animation of the wire between the two components? If I can't make the animation of the wire, it doesn't matter but what I care is about the connection between the components.

FDarfe
  • 13
  • 1
  • 3
  • Please add some clarifications to you question. Are the components to be connected animated ? stationary ? Would a straight line connecting the components be appropriate ? – c0der Aug 06 '18 at 04:30
  • The components will be a JLabel for example, static component, and the line can be both straight or curved, it doesn't matter, I only want to connect the two components with a graphic line and then know which two components are connected. – FDarfe Aug 06 '18 at 16:39
  • Learn how to [draw lines](https://stackoverflow.com/questions/5801734/how-to-draw-lines-in-java) . The components can be represented by `JLables` layed out by a layout manager (or drawn) or [rectangles](https://stackoverflow.com/questions/9713432/drawing-simple-rectangles-on-a-jframe-in-java) – c0der Aug 07 '18 at 03:26

0 Answers0