Here's my sources.
Code:
package main;
import java.awt.*;
public class Main
{
****/**
**** * @param args
**** */
********
****public static void main(String[] args)
****{
********Frame fr = new Window(640, 480, "My Window");
********fr.setVisible(true);
************************
********Button b = new Button("Test");
********b.setSize(100, 20);
********b.setLocation(0, 50);
********fr.add(b);
********
********/*
********Button b = new Button("Test");
********b.setSize(100, 20);
********b.setLocation(0, 30);
********fr.add(b);
*********/
****************
****************
****}
}
And the Window class:
Code:
package main;
import java.awt.*;
import java.awt.event.*;
public class Window extends Frame
{
****/**
**** *
**** */
****
****Image image;
****public Window(int x, int y, String name)
****{
********setSize(640, 480);
********setVisible(true);
********setTitle(name);
********
********addWindowListener (new WindowAdapter()****
************{
****************public void windowClosing(WindowEvent ev)
****************{
********************System.exit (0);
****************}****
************}
********);
********
********setLayout(null);
****}
****
****public void paint(Graphics g)
****{********
********Image im = getToolkit().getImage("Sprites/Character/idle.bmp");
********g.drawImage(im, 0, 0, null);
****************
********g.setFont(new Font("Serif", Font.ITALIC | Font.BOLD, 30));
********g.drawString("Hello, XXI century World!", 20, 100);**
****}
****
}