Java-将图像转换为Icon/ImageIcon? [英] Java - Convert Image to Icon/ImageIcon?
本文介绍了Java-将图像转换为Icon/ImageIcon?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个Image对象,我想将其转换为Icon或ImageIcon以添加到JTextPane中.我将如何去做呢? (这是在JAVA中)
I have an Image object that I would like to convert to an Icon or ImageIcon to add to a JTextPane. How would I go about doing this? (this is in JAVA)
说明:我的图像"是图像对象的实例,而不是文件.
clarification: my "Image" is an instance of the Image Object, not a File.