English 中文(简体)
a. 用java 射线
原标题:about the figure with java applet
  • 时间:2012-04-25 15:05:55
  •  标签:
  • java

i wanna写了一个按java在窗户中显示某一数字的方案,该方案可以编成,而且没有错误,但数字不能在窗户中看到。 该法律有什么错误? 非常感谢。

import java.awt.*;
import java.applet.*;
import java.io.File;
import java.net.URL;
import java.awt.image.*;
import java.awt.image.ImageObserver;
public class MyApp extends Applet implements ImageObserver
{
Image img;

String imgPath="C:\2000.JPEG";
int xpoint=50,ypoint=50;
public void init()
{
    setBackground(Color.blue);
    setForeground(Color.green);
    imgPath="C:\2000_CannotViewImage.gif";
    }
public void paint(Graphics g)
{
    URL imgURL=getDocumentBase();
    img=getImage(imgURL,imgPath);
    g.drawImage(img, xpoint, ypoint, this);
}


}
问题回答

我不知道Swaing 或AWT ,因此,我可以在这方面做很多帮助。

你没有签署该手册就能够进入当地硬盘。 这一进程十分.。 避免将联合分析报告中的形象带进来,并利用ResourceAsStream()获取。

在试捕中处理油漆中的一切材料,并在出现例外时予以印刷。

提 出

import java.applet.Applet;
import java.awt.Graphics;

public class MyImage extends Applet{
    private java.awt.Image image1;
    public void init(){
        image1=getImage(getDocumentBase(),"android.png");
    }
    public void paint(Graphics g){
        g.drawImage(image1,0,0,this);
    }
}




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签