How can I drag images with the mouse cursor in Java GUI?

前端 未结 2 426
失恋的感觉
失恋的感觉 2021-01-22 03:55

// my code that calls upon n images in a directory to be placed on the JPanel

 public void imageAdder(int n, String name){
    BufferedImage myPic = null;
    fo         


        
2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-22 04:26

    Look at custom classes in Java Swing, possibly useful links to get you started:

    Java2s - DragandDropSupportforImages

    DragImage.java DropImage.java DragImageEvent.java

提交回复
热议问题