Trup
Trup

Reputation: 1655

Java - gui: adding a door

I am running a ball collision simulation, and I want to add a door somewhere along the edges of the frame, such that when a ball touches it, it disappears. What is the simplest Swing component that can give me the functionality of this door?

Upvotes: 1

Views: 208

Answers (2)

trashgod
trashgod

Reputation: 205775

I want to know what…can be used to graphically represent the image of that door.

You probably want an overhead view, but you might get some ideas from this example that animates a door opening and closing en face.

Addendum: As you are interested in animation, see also these variations on a bouncing ball and this KineticModel.

Upvotes: 1

Code-Apprentice
Code-Apprentice

Reputation: 83527

There is no Swing component that will give this functionality. You will have to write it yourself. If you need some additional directly, please post more information about what your existing ball collision program does, including some code snippets to illustrate what you have done so far.

Upvotes: 0

Related Questions