当前位置:IT认证>软件水平

问题:[填空题]

[填空题] 下列JApplet实现了一个不可编辑的JTextArea和一个JButton。请填写正确的程序代码。 import javax.swing.*; import java.awt.*; public class Test17 extends JApplet JTextArea jta; public void init() Container cp = getContentPane(); cp.setLayout( new GridLayout(2,1)); jta =

  

参考答案:

cp.add(jtA)

  参考解析

在JApplet中添加构件就是在内容面板中添加构件,因此需要先得到内容面板,然后再向其中添加Swing构件。

微信端