I'm looking to drag and drop an image from my desktop onto my JPanel/Jframe then be able to store that image into a BufferedImage object and do what id like with it
is there a way to do this with MouseListener?
here's a made-up example of a perfect world in which I could do this
Jframe jframe = new Jframe();
//set up jframe bla bla bla
MouseListener ml = new MouseListener(){
mouseRealeased(MouseEvent e){
//get droped thing from e
if(check if dropped thing is an image){
this.myImageField = (BufferedImage)droppedThing;
}
}
}
jframe.addMouseListener(ml);
I hope you get the idea. not looking for something super complicated. I'm a noob keep it as simple as possible thanks :)