Re: Windows Desktop Applet

Discussion in 'Java' started by John Stewart, Jun 30, 2003.

  1. John Stewart

    John Stewart Guest

    I turned off the jit compiler and have the use plugin checked in
    internet options. But other than that im not sure.
    John Stewart

    "Andy Flowers" <> wrote in message news:<WPJIa.480$>...
    > Are you using the microsoft VM or that plug-in VM ?
    >
    > I have read elsewhere (a long time ago) that the desktop version needs the
    > Microsoft VM.
    >
    > "jvstewart" <> wrote in message
    > news:eek:xIIa.84575$...
    > > I have a html file set as the background for my Windows XP Desktop. I

    > made
    > > a simple applet that gets the current date and time and displays it on the
    > > desktop. I cant get anything but the gray rectangle where the text should
    > > appear. I have another applet i downloaded from the web that works fine.
    > >
    > > here is the code i am using in my applet:
    > >
    > > import java.applet.Applet;
    > > import java.awt.*;
    > > import java.text.*;
    > > import java.util.*;
    > >
    > >
    > > public class TimeDate extends Applet {
    > >
    > > String dateTime;
    > > int x;
    > >
    > > public void init() {}
    > > public void start() {
    > > repaint();
    > > }
    > >
    > > public void stop() {}
    > >
    > > public void destroy() {}
    > >
    > > public void paint(Graphics g)
    > > {
    > > DateFormat df = DateFormat.getDateInstance();
    > > DateFormat tf = DateFormat.getTimeInstance();
    > >
    > > Date dt = new Date();
    > > dateTime = df.format(dt);
    > > Date tm = new Date();
    > >
    > > dateTime = dateTime + " " + tf.format(tm);
    > >
    > > //Graphics2D g2 = (Graphics2D)g;
    > > Rectangle r = new Rectangle(0,0,200,25);
    > > //g.setColor(Color.blue);
    > > //g.fill(r);
    > > g.setColor(Color.white);
    > > g.drawString(dateTime,5,20);
    > > }
    > > };
    > >
    > >
    > > Here is the html i am using
    > >
    > > <applet code="c:\j2sdk1.4.1\bin\TimeDate.class" width=200
    > > height=25></applet>
    > >
    > > Anyone have any ideas?
    > >
    > > Thank you
    > > John Stewart
    > >
    > >
    John Stewart, Jun 30, 2003
    #1
    1. Advertising

  2. John Stewart

    Andy Flowers Guest

    You're using the external plug-in, this is the SUN Java. Uncheck the check
    box to use the Microsoft VM (you may need to reboot for it to have an
    effect) and see what happens.

    "John Stewart" <> wrote in message
    news:...
    > I turned off the jit compiler and have the use plugin checked in
    > internet options. But other than that im not sure.
    > John Stewart
    >
    > "Andy Flowers" <> wrote in message

    news:<WPJIa.480$>...
    > > Are you using the microsoft VM or that plug-in VM ?
    > >
    > > I have read elsewhere (a long time ago) that the desktop version needs

    the
    > > Microsoft VM.
    > >
    > > "jvstewart" <> wrote in message
    > > news:eek:xIIa.84575$...
    > > > I have a html file set as the background for my Windows XP Desktop. I

    > > made
    > > > a simple applet that gets the current date and time and displays it on

    the
    > > > desktop. I cant get anything but the gray rectangle where the text

    should
    > > > appear. I have another applet i downloaded from the web that works

    fine.
    > > >
    > > > here is the code i am using in my applet:
    > > >
    > > > import java.applet.Applet;
    > > > import java.awt.*;
    > > > import java.text.*;
    > > > import java.util.*;
    > > >
    > > >
    > > > public class TimeDate extends Applet {
    > > >
    > > > String dateTime;
    > > > int x;
    > > >
    > > > public void init() {}
    > > > public void start() {
    > > > repaint();
    > > > }
    > > >
    > > > public void stop() {}
    > > >
    > > > public void destroy() {}
    > > >
    > > > public void paint(Graphics g)
    > > > {
    > > > DateFormat df = DateFormat.getDateInstance();
    > > > DateFormat tf = DateFormat.getTimeInstance();
    > > >
    > > > Date dt = new Date();
    > > > dateTime = df.format(dt);
    > > > Date tm = new Date();
    > > >
    > > > dateTime = dateTime + " " + tf.format(tm);
    > > >
    > > > //Graphics2D g2 = (Graphics2D)g;
    > > > Rectangle r = new Rectangle(0,0,200,25);
    > > > //g.setColor(Color.blue);
    > > > //g.fill(r);
    > > > g.setColor(Color.white);
    > > > g.drawString(dateTime,5,20);
    > > > }
    > > > };
    > > >
    > > >
    > > > Here is the html i am using
    > > >
    > > > <applet code="c:\j2sdk1.4.1\bin\TimeDate.class" width=200
    > > > height=25></applet>
    > > >
    > > > Anyone have any ideas?
    > > >
    > > > Thank you
    > > > John Stewart
    > > >
    > > >
    Andy Flowers, Jun 30, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?S3Jpc3RqYW4gU2FuZGVy?=

    Accessing ascx file from windows desktop application

    =?Utf-8?B?S3Jpc3RqYW4gU2FuZGVy?=, Jul 7, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    350
    =?Utf-8?B?S3Jpc3RqYW4gU2FuZGVy?=
    Jul 7, 2004
  2. TC
    Replies:
    4
    Views:
    658
    JohnnyAppleseed
    Feb 7, 2005
  3. P. Flavin
    Replies:
    0
    Views:
    477
    P. Flavin
    Sep 16, 2003
  4. Paul
    Replies:
    11
    Views:
    496
    Roedy Green
    Aug 19, 2009
  5. iMath
    Replies:
    7
    Views:
    1,707
    iMath
    Nov 10, 2013
Loading...

Share This Page