Go Back   Forums > Community Chatterbox > Tech Corner > Programming
Memberlist Forum Rules Today's Posts
Search Forums:
Click here to use Advanced Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 


Similar Threads
Thread Thread Starter Forum Replies Last Post
I need a Java tutorial... Fubb Programming 12 13-04-2009 10:26 AM
10th Frame Pro Bowling Simulator Romano Games Discussion 3 20-07-2008 02:52 PM
How To Use Java Vm In Windows Xp? The Fifth Horseman Tech Corner 19 27-07-2005 10:29 PM
Java Game Reaperman Programming 3 23-02-2005 02:27 PM
Java Kon-Tiki Tech Corner 50 13-12-2004 12:19 AM


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump
 


The current time is 08:06 PM (GMT)

 
Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.