How can I display a BufferedImage in a JFrame?(如何在 JFrame 中显示 BufferedImage?)
问题描述
我想在同一个 JFrame 中显示同一图像的变体,例如在 JFrame 中显示一个图像,然后将其替换为同一图像的灰度.
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.
推荐答案
每次更新图像时都必须重新绘制 JFrame.
You will have to repaint the JFrame whenever you update the image.
这是一个关于该主题的简单谷歌带来的内容:(我使用这些教程进行所有 Java 编码)
Here is what a simple google on the topic brings up: (I use those tutorials for all my Java coding)
Java 教程:绘制图像
这篇关于如何在 JFrame 中显示 BufferedImage?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 JFrame 中显示 BufferedImage?
基础教程推荐
- 多个组件的复杂布局 2022-01-01
- 在 Java 中创建日期的正确方法是什么? 2022-01-01
- Java 实例变量在两个语句中声明和初始化 2022-01-01
- Java Swing计时器未清除 2022-01-01
- 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01
- 验证是否调用了所有 getter 方法 2022-01-01
- 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01
- 从 python 访问 JVM 2022-01-01
- 大摇大摆的枚举 2022-01-01
- 不推荐使用 Api 注释的描述 2022-01-01
