[英]Display image on JFrame form Java NetBeans
but i cant find any image container I
但我找不到任何图像容器
Add an ImageIcon
to a JLabel
. 将
ImageIcon
添加到JLabel
。
Icon icon = new ImageIcon(...);
JLabel label = new JLabel( icon );
frame.add( label );
Read the section from the Swing tutorial on How to Use Icons for a working example. 阅读Swing教程中有关如何使用图标的部分,了解一个有效的示例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.