|
本题添加时间:2023/10/10 13:30:00 |
|
圆梦客服:王老师 19139051760(微信同号) 19139051760(微信同号) |
阅读下面的程序,回答问题(问3分,问3分,共6分)。 import java.awt.*; import javax.swing.*; public class T extends JFrame { public T ( ) { super("GridLayout"); Container con=this.getContentPane(); con.setLayout(new GridLayout(2,3)); con.add(new JButton("a")); con.add(new JButton("b")); con.add(new JButton("c")); con.add(new JButton("d")); con.add(new JButton("e")); con.add(new JButton("f")); setSize(200, 80); setVisible(true); } public static void main(String args[]) { new T(); } } 画图表示程序运行后的图形界面。 如果程序通过实现某个接口处理按钮的动作事件,则该接口名为何?接口中的方法头声明如何?
|
答案是:
接口名:ActionListener 接口中的方法:public void actionPerformed(ActionEvent e)
出自
江苏开放大学JAVA程序设计形成性考核作业1 江开系统
青岛科技大学
|
更多试题>>>>
1、下列程序的运行结果是__12345____。
public class MyClass {
int a[] = { 1, 2, 3, 4, 5 };
void out() {
for (int j = 0; j < a.
2、以下程序的输出结果__。
public class Father {
String name, address, tel;
int age;
public Father(String name, int age) {
3、以下程序的输出结果为_____。
public class Tom {
private float weight;
private static String name;
public void setWeight(flo
4、以下程序的输出结果为_____。
public class Course {
private String cNumber;
private String cName;
private int cUnit;
publi
5、以下程序的输出结果为________。
public class Person {
String name;
int age;
public Person(String name, int age) {
this.n
|