Get "Frame"(?) as a methode
I'm kind of new to java (kind of, i know the basics by now) :)
Anyway, as our first script in school, we did a "frame" code, that gave out a box with text inside. that was just to see how a code looked like... Now, 1,5 years later, i'm still trying to figure how it works.
Anyway, now i want to implent the old code as a method into another code. Is that possible?
The code (Edited today, with lines i found on internet :p )
Anyone can help me implenitng in into another code?
class test2 extends Frame
Dimension ssize = Toolkit.getDefaultToolkit().getScreenSize();
int x = (int) (ssize.getWidth()) / 2;
int y = (int) (ssize.getHeight()) / 2;
test2() //konstruktor för klassen test2
public void paint(Graphics g)
g.drawString("Vakna", x, y);
public static void vakna()
test2 t2 = new test2();
doesn't seem to be enough