0xOffset
0xOffset

Reputation: 45

Implementing drag and drop into a image viewer

Im an intermediate programmer making my own little image viewer. Currently I'm looking into implementing a Drag-and-Drop feature. Ive done some research and have seen that you need to use image icon b/c it is serializable, the code seems pretty complicated. The DnD would be on images dragged to the panel. I have a few questions.

  1. what swing component would work best to hold the image?
  2. what would be the easiest way to implement this feature?

Upvotes: 1

Views: 471

Answers (2)

Robin
Robin

Reputation: 36611

Implementing drag-and-drop functionality is not that hard

Upvotes: 2

COD3BOY
COD3BOY

Reputation: 12092

what swing component would work best to hold the image?

Why not a JLabel?

Upvotes: 3

Related Questions