单项选择题

下列程序向JApplet中增加了一个按钮,横线处应填入的正确代码是______。
importjavax.swing.*;
importjava.awt.*;
public classSwingApplet extends JApplet{
JButton b=new JButton("Begin");
public voidinit(){
ContainercontentPane=______;
contentPane.add(b);
}
}

A.getContentPane()
B.new Jpanel()
C.new Panel()
D.new ContentPane()
题目列表

你可能感兴趣的试题

微信扫码免费搜题