一般的绘图程序要定义一个JPanel子类。在JPanel子类中还要重定义一个方法,在这个方法中调用绘图方法,绘制各种图形。要重定义的方法是()。
A.paint()
B.paintComponent()
C.repaint()
D.update()
A.paint()
B.paintComponent()
C.repaint()
D.update()
编写时具有Applet与Application特征的程序。具体方法是:作为Application要定义 main()方法,并且把main()方法所在的类定义为一个public类。为使该程序成为一个Applet,main()方法所在的这个类必须继承Applet类或【 】类。
编写同时具有Applet与Application特征的程序,具体的方法是:作为Application要定义main()方法,并且把main()方法所在的类定义为一个【 】类,为使该程序成为一个Applet,main()方法所在的这个类必须继承Applet类或JApplet类。
A自行车,摩托车,红旗轿车
B篮球,足球,排球
C教练,球员,足球
D足球课,排球课,篮球课
下面ChangeTitle()中对b1和b2按钮构造监听器,实现当单击b1按钮时标题变为students,当单击b2按钮时标题变为Teachers。请将程序补充完整。 public ChangeTitle() { super("Title Bar"); b1.addAetionListener(this); 【 】 Jpanel pane = new Jpanel(); Pane.add(b1); Pane.add(b2); SetContentPane(pane); public void actionPerformed(ActionEvent evt) { Object sourve = evt.getSource(); if (sourve ==b1) setTitle("Students"); else if (source == b2) setTitle("Teachers"); repaint(); }