问题:
Given the following code, which code fragments, when inserted at the indicated location, will succeed in making the program display a button spanning the whole window area?()
import java.awt.*;
public class Q1e65 {
public static void main(String args[]) {
Window win = new Frame();
Button but = new Button("button");
// insert code fragment here win.setSize(200, 200);
win.setVisible(true);
}
}
A . win.setLayout(new BorderLayout()); win.add(but);
B . win.setLayout(new GridLayout(1, 1)); win.add(but);
C . win.setLayout(new BorderLayout()); win.add(but, BorderLayout.CENTER);
D . win.add(but);
E . win.setLayout(new FlowLayout()); win.add(but);
Given the following code, which code fragments, when inserted at the indicated location, will succeed in making the program display a button spanning the whole window area?()
import java.awt.*;
public class Q1e65 {
public static void main(String args[]) {
Window win = new Frame();
Button but = new Button("button");
// insert code fragment here win.setSize(200, 200);
win.setVisible(true);
}
}
● 参考解析
本题暂无解析