填空题

现在有Java Applet小程序的源程序文件MyApplet.java,编译后生成的字节码文件为MyApplet.class,对应的HTML文件为MyApplet.html。查看该小程序的运行结果两种方式:运行命令 【14】 ;直接用浏览器打开MyApplet.html文件。

【参考答案】

appletviewer MyApplet.html
<上一题 目录 下一题>
热门 试题

填空题
有如下代码片段,请在画线处填入正确的代码,使程序运行正确。 import javax.swing.*; import java.awt.*; import java.event.*; public class JAppletTest extends 【12】 public void init( ) Container contentPane = getContentPane( ); Icon icon = new ImageIcon( swing.gif , A GIF on a swing ); JLabel label = new JLabel( Swing! , icon, SwingConstants.CENTER); contentPane.add(label, BorderLayout.CENTER);
填空题
下面ChangeTitle()中对b1和b2按键构造监听器,实现当按下b1键时标题变为Students,当按下b2键时标题变为Teachers。添加空缺的语句。 ... public ChangeTitle() super( Title Bar ); b1.addActionListener(this); 【11】 ; Jpanel pane = new Jpane1(); 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(); ...
相关试题
  • 有下列程序段 public class fun public...
  • 以下程序段的输出结果是( )。 int x=...
  • 下列程序的运行结果是( )。 public cl...
  • 有如下的代码段,当编译和运行时,下列各选...
  • 如下的代码段中,如果方法unsafe()正常运...