在Java GUI程序设计中,以下哪个方法不是由java.awt.Component类提供的?
答案解析
在Java GUI程序设计中,setVisible(boolean b)、setSize(int width, int height)和setLayout(LayoutManager mgr)都是由java.awt.Component类或其子类提供的方法。而add(Component comp)是由java.awt.Container类提供的方法,用于向容器中添加组件。因此,选项B不是由java.awt.Component类提供的方法。
正确答案:B