🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #415

A little code problem

#415
From: Aris
Date: Wed, 04 May 2005 17:37
75 lines
2168 bytes
I've tried to make the beginning of a known game.

You got a paddle and you move it to repulse a ball

coming of above. But my code here failed.

The compiler didn't warned of something but the applet viewer

answered this:

<<Start: applet not initialized.>>

Is there anyone who can help me?

--------------------------------------------

import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;

public abstract class paddle extends Applet implements
MouseListener,MouseMotionListener
{
public int x,y;
 public void init()
 {
 addMouseListener(this);
 addMouseMotionListener(this);
 }

 public void setState(int x1,int y1){
 x=x1;
 y=y1;

 }

 public void mouseMoved(MouseEvent e)
 {
 setState(e.getX(),e.getY());
 }


 public void paint(Graphics g)
 {
 setBackground(Color.gray);
 g.setColor(Color.blue);
 g.fillRect(190,450,160,20);
 g.setColor(Color.blue);
 g.fillRect(x,y,160,20);
 repaint();

 }




}

------------------------------------------------

the HTML file:

------------------------------------------------

<HTML>
<HEAD>
<TITLE>.....</TITLE>
</HEAD>
<BODY>
<P>
<APPLET code=paddle.class width=540 height=480>
</APPLET>
</P>
</BODY>
</HTML>
Technical Details
Message-ID: <d5b18n$cbs$1@usenet.otenet.gr>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed.freenet.de!tsicnews.teliasonera.com!news.otenet.gr!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,febb320617f8dd3e,start
X-Google-Attributes: gid111d45,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed.freenet.de!tsicnews.teliasonera.com!news.otenet.gr!not-for-mail
From: "Aris" <1136534760@otenet.gr>
Newsgroups: borland.public.jbuilder.java.swing
Subject: A little code problem
Date: Wed, 4 May 2005 20:37:23 +0300
Organization: An OTEnet S.A. customer
Lines: 84
Message-ID: <d5b18n$cbs$1@usenet.otenet.gr>
NNTP-Posting-Host: pppd-595.otenet.gr
X-Trace: usenet.otenet.gr 1115228248 12668 62.103.171.87 (4 May 2005 17:37:28 GMT)
X-Complaints-To: abuse@otenet.gr
NNTP-Posting-Date: Wed, 4 May 2005 17:37:28 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000