How can I display a BufferedImage in a JFrame?

前端 未结 4 1161
失恋的感觉
失恋的感觉 2020-12-10 03:10

I want to display variations of the same image in the same JFrame, for example display an image in JFrame, then replace it with gray scale of the same image.

4条回答
  •  星月不相逢
    2020-12-10 03:23

    You will have to repaint the JFrame whenever you update the image.

    Here is what a simple google on the topic brings up: (I use those tutorials for all my Java coding)

    Java Tutorial: Drawing an Image

提交回复
热议问题