题目内容

本题程序的功能是主窗口有一个按钮、一个文本域和一个复选框,初始时窗口的大小是不能调整的,勾选复选框后,窗口大小就可以进行调整,如果取消勾选复选框,则窗口的大小又不能调整,单击按钮可以关闭程序。请将下述程序补充完整(注意:不得改动程序的结构,不得增行或删行)。 import java.awt.*; import java.awt.event.*; class MyFrame extends Frame______ Checkbox box; TextArea text; Button button; MyFrame(String s) super (s); box = new Checkbox("设置窗口是否可调整大小"); text = new TextArea(12,12); button = new Button("关闭窗口"); button.addActionListener(this); box.addItemListener(this); setBounds(100,100,200,300); setVisible(true); add(text,BorderLayout.CENTER); add(box,BorderLayout.SOUTH); add(button,BorderLayout.NORTH); ______; validate (); public void itemStateChanged(ItemEvent e) if (box.getState() == true) setResizable(true); else setResizable(false); public void actionPerformed(ActionEvent e) dispose(); class simple public static void main(String args[]) new MyFrame("simple");

查看答案
更多问题

The private detective, having received new information from a confidential source, narrowed down the ______ of his enquiry into the case.

A. aspect
B. sphere
C. dimension
D. scope

(a)Write short notes on the following: (i)BACS (ii)CHAPS (iii)CHIPS (iv)FedWire (b)What are the significance and limitations of the balance sheet

What are the warning signals to potential bad loans Explain them.

What are the factors affecting the level of money supply in Hongkong

答案查题题库