0
我试图面板的内容开关元件和图像之间, 它适用于组件:为什么java.awt.Image不被视为java.awt.Component?
imgpanel.removeAll();
Component comp;
if ((comp = player.getVisualComponent()) != null) {
imgpanel.add(comp);
}
因为图片:
btoi = new BufferToImage((VideoFormat) buf.getFormat());
img = btoi.createImage(buf);
imgpanel.removeAll();
imgpanel.add(img);//The method add(Component) in the type Container is not applicable for the arguments (Image)
我应该怎么做吗?