更多"小应用程序运行后在窗口中显示一幅图片。 import java. a"的相关试题:
[填空题]下列Applet在坐标(20,20)处显示一幅GIF图像,请填写正确的程序在横线处。
import java.awt.*;
import java.applet.*;
import java.net.URL;
public class Test13 extends Applet
{
Image i;
public void init( )
{
URL url=getDocumentBase( );
String name="IMG onClick=over(this) title=放大0.gif";
【15】 ;
}
public void paint(Graphics g)
{
g.drawImage( i,20,20, this);
}
}
[填空题]小应用程序启动后自动播放一个“2.wav”声音文件。请完成程序。
import java.applet.*;
public class C3001 extends Applet
public void start( )
______clip=getAudioClip(getCodeBase( ),"2.wav");
______play( );
[填空题]下面程序运行后显示一个窗口,在窗口中有一个按钮,请完成程序。
import javax.swing.*;
public class Class28
public static void main(String[] args)
JFrame mw=new JFrame("我的窗口");
mw.setSize(300,400);
JButton button=new JButton("我是按钮");
mw.______.add(button);
mw.______;
[填空题]下面程序运行后显示一个窗口,在窗口中有一个按钮和一个标签,单击按钮,标签中显示按钮被单击的次数,请完成程序。
import java. awt.*;
import javax. swing.*;
import java. awt. event.*;
class myFrame extends JFrame implements ActionListener
JButton button;
JLabel label;
myFrame(String s)
super(s);
Container con=______;
setLayout(new FlowLayout( ));
setDefaultCloseOperation(JFrame. EXIT_ON_CLOSE);
setSize(300,400);
button=new JButton("OK");
label=new JLabel("0");
con. add(button);con.add(label);
button. addActionListener(this);
setVisible(true);
public void actionPerformed(ActionEvent e)
int n=______;
n++;
label. setText(" "+n);
public class C2801
public static void main(String[] args)
new myFrame("我的窗口");
[判断题]Windows的窗口空间有限,有时正文并未完全在窗口工作区中显示,可利用窗口的移动来浏览整个文档内容。
[单项选择]
Greenspace facilities are contributing to an important extent to the quality of the urban environment. Fortunately it is no longer necessary that every lecture or every book about this subject bas to start with the proof of this idem At present it is generally accepted, although more as a self-evident statement than on the base of a closely-reasoned scientific proof. The recognition of the importance of greenspace in the urban environment is a first step on the fight way, this does not mean, however, that sufficient details are known about the functions of greenspace in towns and about the way in which the inhabitants are using these spaces. As to this rather complex subject I shall, within the scope of this lecture, enter into one aspect only, namely the re-creative function of greenspace facilities.
The theoretical separation of living, working, traffic and recreation which for many years has been used in town and country planning, has in my opinion resulted in dispropo
A. is still unknown
B. is being Closely studied
C. is usually neglected
D. has been widely accepted