🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #1542

Help me please.. going crazy... !!

#1542
From: Iman Habib
Date: Thu, 29 Nov 2001 21:06
130 lines
3273 bytes
gaaaaaaaaaaaaaaa
i know that this is a bit OT.
but i really need help :..(


I made this applet for my webcam..
It works great when i look at with appletviewer.exe

try -> appletviewer.exe http://sajber.mine.nu


But not when i enter the hompage with a web browser.

http://sajber.mine.nu


I have tested this on several machines but
the same thing happens.. no loading of the
images. just a white frame.. =(

It seems to stop working when the applet
is trying to download the images..
So the applet is actuallt executed.


please.. can anyone help me out here ??


The code is quite small. Please compile the
code and try it yourself. My webcam is up 24/7.


javacode:
-------8<-------Webcam2.java--------8<--------

import java.awt.*;
import javax.swing.*;
import java.applet.*;
import java.net.*;

public class Webcam2 extends Applet implements Runnable
{
    public Thread akt;
    Canvas can = new Canvas();
    ImageIcon imc;

    int width  = 320;
    int height = 240;

    public void init()
    {
        setLayout(new GridLayout());
        setBackground(Color.white);
        can.setBounds(0,0,width,height);
        add(can);
    }

    public void start()
    {
      if(akt == null)
      {
        akt = new Thread(this);
        akt.start();
      }
    }

    public void stop()
    {
      if(akt != null)
      {
        akt.interrupt();
        akt = null;
      }
    }

    public void run()
    {
      try {
          imc = new ImageIcon( new URL("http://sajber.mine.nu/loading.jpg") );
      } catch(Exception e) { }

      draw();
      imc.getImage().flush();

      sleep(1000);

      while(akt != null)
      {
        try {
          imc = new ImageIcon( new URL("http://sajber.mine.nu:6666/") );
        } catch(Exception e) { }

        draw();
        imc.getImage().flush();
      }
    }

    public void draw()
    {
      Graphics gc = can.getGraphics();
      imc.paintIcon(can,gc,0,0);
    }

    public void sleep(int ms)
    {
      try { Thread.currentThread().sleep(ms); }
      catch(Exception e) { }
    }

}
-------8<---------------8<--------


webpage code:
-------8<------index.html-----8<--------
<html>
<head>

<title>Me, Myself and my Livingroom</title>

<body>

<applet code="Webcam2.class"
        width="320" height="240">
</applet>


</body>
</html>
-------8<---------------8<--------
Technical Details
Message-ID: <3c06a257$1_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,2fd5977b3918ebb2,start
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2001-11-29 13:05:45 PST
From: "Iman Habib" <pixelpajas@hotmail.com>
Newsgroups: borland.public.jbuilder.java.api
Subject: Help me please.. going crazy... !!
Date: Thu, 29 Nov 2001 22:06:17 +0100
Lines: 135
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 194.236.50.233
Message-ID: <3c06a257$1_1@dnews>
X-Trace: dnews 1007067735 194.236.50.233 (29 Nov 2001 13:02:15 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews