王老师:19139051760(微信同号)  13333709510
联大   青书学堂   文才   和学   现代兴业   安徽教育在线   超星   弘成   广东开放大学   国家开放大学   上海开放大学   含弘慕课 

教育服务

成人高校
成考录取分数线
我要提升学历
提升学历的理由:
升职加薪、积分落户、考研、公务员考试、子女入学、出国留学


成人高考报名入口

当前位置: 首页 > 江开系统 > 青岛科技大学> 江苏开放大学JAVA程序设计形成性考核作业1
 

输入试题:
本题添加时间: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


提升学历-成人高考报名入口 提升学历-成人高考院校名单