View Single Post
Old 22-03-2007, 06:01 PM   #1
Nick
Переводчик помаленьку
 
Nick's Avatar

 
Join Date: Dec 2004
Location: Protvino, Russian Federation
Posts: 340
Send a message via ICQ to Nick Send a message via Skype™ to Nick
Default

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);**
****}
****

}
__________________
"Paladin work is never done..."


Nick is offline                         Send a private message to Nick
Reply With Quote