How do I draw an image to a JPanel or JFrame?(如何将图像绘制到 JPanel 或 JFrame?)
问题描述
如何将图像绘制到 JPanel 或 JFrame,我已经阅读了 oracle 的教程,但我似乎无法正确理解.我需要将图像BeachRoad.png
"显示在一组特定的坐标上.这是我目前所拥有的.
How do I draw an Image to a JPanel or JFrame, I have already read oracle's tutorial on this but I can't seem to get it right. I need the image "BeachRoad.png
" to be displayed on a specific set of coordinates. Here is what I have so far.
在 Main() 中,
And in the Main(),
提前致谢!
推荐答案
试试这个:
这篇关于如何将图像绘制到 JPanel 或 JFrame?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!