There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
.dbx file audio avg avg 8 brand new bsod chinese codec conversion crash desktop display dos driver duplicate dvd error error message excel explorer file firefox game hardware hijackthis log hjt install installation internet ipod javascript laptop low disk space macro malware msconfig msn music nero express network outlook outlook 2003 outlook express php pro problem rows rundll32 security seo sound sp3 spyware switch tag cloud trojan usb video virus vista vundo wallpaper windows windows vista windows xp wireless word xp service pack xp sp3 youtube
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Java Help!


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
bootsiebella's Avatar
Junior Member with 12 posts.
 
Join Date: Mar 2008
09-May-2008, 02:47 PM #1
Java Help!
I am not sure if I am doing this right I have to write a Java Applet which would display a dialog box to the screen which reads “Summer Break has officially BEGUN!” I believe I am going to need a test file too which I don't understand, because I have to Submit both the .java file(s) and the .html file). Can anyone tell me if I did this right?


import java.awt.*;
import java.applet.*;

public class SummerApplet extends Applet {

// An applet that simply displays the string “Summer Break has officially BEGUN!”

public void paint(Graphics g) {
g.drawString("Summer Break has officially BEGUN!”, 10, 30);
}

} // end of class SummerApplet
Chicon's Avatar
Computer Specs
Distinguished Member with 6,213 posts.
 
Join Date: Jul 2004
Location: 50° 34' 07.13" N - 04° 10' 23.58" E
Experience: Intermediate
09-May-2008, 05:19 PM #2
Hi bootsiebella,

Here's the easiest way to view your applet :

- compile your class SummerApplet;
- copy the result of the compilation, the file SummerApplet.class in a folder of your choice;
- copy paste the content of the following pane in a Notepad window and save the file with a .html extension into the above mentioned folder;
Code:

<html>
    <head>
        <title>Test Applet</title>
    </head>
    <body>
        <p align=center><applet code=SummerApplet.class alt="SummerApplet" width=250 height=150></applet></p>
    </body>
</html>
- make sure your favourite Internet browser is Java enabled;
- open the .html file you've just created with your Internet browser and watch the result of your coding !
__________________
for ( ; ; ) ;

Examinations time is coming, take a Java beta exam and get a belt !
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 01:24 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.