K
Kevin
It should be real easy but I'm having troubles.
I can't seem to get this darn frame to resize (or setsize) when the applet
is launched. All I get is a little frame window which I can then maximize
and see my applet. I think I have tried ever possible combination of the
Frame methods.
Could someone please lend a helping hand please don't make me beg.
Here is my watered down code.
import java.awt.*;
public class test extends java.applet.Applet {
Image currentimg;
Graphics currentGraphics;
Frame myframe;
static Dimension d;
public void init() {
myframe = new Frame("Test Applet");
d = Toolkit.getDefaultToolkit().getScreenSize();
myframe.add(this);
myframe.setSize(d.width, d.height);
myframe.setVisible(true);
myframe.pack();
myframe.show();
currentGraphics = getGraphics();
paint(currentGraphics);
}
public void run() {
}
public void update(Graphics g) {
paint(g);
}
public void paint(Graphics g) {
g.drawString("hello world",10,20);
}
}
I can't seem to get this darn frame to resize (or setsize) when the applet
is launched. All I get is a little frame window which I can then maximize
and see my applet. I think I have tried ever possible combination of the
Frame methods.
Could someone please lend a helping hand please don't make me beg.
Here is my watered down code.
import java.awt.*;
public class test extends java.applet.Applet {
Image currentimg;
Graphics currentGraphics;
Frame myframe;
static Dimension d;
public void init() {
myframe = new Frame("Test Applet");
d = Toolkit.getDefaultToolkit().getScreenSize();
myframe.add(this);
myframe.setSize(d.width, d.height);
myframe.setVisible(true);
myframe.pack();
myframe.show();
currentGraphics = getGraphics();
paint(currentGraphics);
}
public void run() {
}
public void update(Graphics g) {
paint(g);
}
public void paint(Graphics g) {
g.drawString("hello world",10,20);
}
}