程序如下“import java.applet.*;
import java.awt.*;
import javax.swing.*;
public class ImageScale extends JApplet
{
private Image narrow;
private ImageIcon narrow2;
private int w,h,jw,ih;
public void init()
{
narrow=getImage(getDocumentBase(),"b.gif");
narrow2=new ImageIcon("b.gif");
w=getWidth();
h=getHeight();
iw=narrow2.getIconWidth();
ih=narrow2.getIconHeight();
}
public void paint(Graphics g)
{
narrow2.paintIcon (this,g,(w-iw)/2,0);
g.drawImage (narrow,0,ih+10,w,h-(ih+10),this);
showStatus("\t\tdadsd");
}}
import java.awt.*;
import javax.swing.*;
public class ImageScale extends JApplet
{
private Image narrow;
private ImageIcon narrow2;
private int w,h,jw,ih;
public void init()
{
narrow=getImage(getDocumentBase(),"b.gif");
narrow2=new ImageIcon("b.gif");
w=getWidth();
h=getHeight();
iw=narrow2.getIconWidth();
ih=narrow2.getIconHeight();
}
public void paint(Graphics g)
{
narrow2.paintIcon (this,g,(w-iw)/2,0);
g.drawImage (narrow,0,ih+10,w,h-(ih+10),this);
showStatus("\t\tdadsd");
}}
解决方案 »
- DES解密是报错,请解。。。
- 用bat运行java开发程序并获得返回值?
- 有多少人可以实现它?
- hibernate+MYSQL 找不到列问题
- "abc".equals(str) ,str.equals("abc")哪个 效率高一些?
- java新手,有谁有thinking in java 电子书?
- 怎么用InputStream读取字母数字和汉字的混合流?
- 有关同一package下两个class的问题
- java习题:主机名排序
- 请问怎样才能使TextField()中的字符一开始就被设置为选中状态? (请举个例子)谢谢
- 请问:java2D,java3D图形设计方面的资料(web site or books)
- 各位请看一下这个代码
package YourName;
你任意取一个也未尝不可。