I came across a problem when trying to implement a graphic buffer. If I
extend the Panel class and then try to do "buffer = image.getGraphics();"
I get a bunch of errors. Here are the errors, and a simple program follows
that presents the errors.
please reply to ar...@ironarmdillo.com
thanx
appletviewer damn.html
java.lang.IllegalArgumentException
at java.text.MessageFormat.format(MessageFormat.java)
at java.text.MessageFormat.format(MessageFormat.java)
at java.text.Format.format(Format.java)
at
sun.applet.AppletMessageHandler.getMessage(AppletMessageHandler.java:63)
at
sun.applet.AppletMessageHandler.getMessage(AppletMessageHandler.java:78)
at sun.applet.AppletPanel.showAppletStatus(AppletPanel.java:554)
at sun.applet.AppletPanel.run(AppletPanel.java:330)
at java.lang.Thread.run(Thread.java)
here is the code....to make it work just start a comment at the first init
method, and replace the '//' with '*/' -- then the code will work.
As it is now, it does not work. I am using JDK1.1.1 Solaris.
/* Aryeh Goldsmith ar...@ironarmadillo.com */
import java.awt.*;
import java.applet.*;
public class damn extends Applet {
private Graphics buf;
private Image im;
public void init(){
Buf b = new Buf();
add(b);
}
}
class Buf extends Panel {
private Graphics buf;
private Image im;
public Buf (){
// public void init(){
im = createImage(140,360);
buf = im.getGraphics();
buf.drawString("Damn!!!",30,30);
}
public void paint(Graphics g) {
g.drawImage(im,0,0,this);
}
}
[0;34;42m
Aryeh Goldsmith
ar...@ironarmadillo.com
agol...@its.brooklyn.cuny.edu
[5;30;42m
Q:Does your browser handle the <aryeh> tag?!?
Perhaps you should get the aryeh plugin.
[0m