www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Server-Side Development > Java
    (NOT JavaScript!)

    Java
    (NOT JavaScript!)
    For discussion of the Java programming language as it applies to the Web ( Not JavaScript ).

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 01-06-2005, 08:24 PM
    keko4201 keko4201 is offline
    Registered User
     
    Join Date: Aug 2004
    Posts: 61
    applet help

    hey guys hows it goin, finished with school now, and on my own i am learning applets. um now this might be a stupid question , but this isnt working for me, not sure whats up. how do i save a java text as a class file. cause im using this code and in the utorial, they show the target using a class file, not a .java file. not sure if it make a difference or not, so i used the file that it saved as(.Java).

    can someone help

    /////////////////////////////////////////////////////////////////////
    java file
    /////////////////////////////////////////////////////////////////////

    import java.applet.Applet;
    import java.awt.Graphics;

    public class HelloWorld extends Applet {
    public void paint(Graphics g) {
    g.drawString("Hello world!", 50, 25);
    }
    }




    with this html





    <html>

    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>New Page 1</title>
    </head>

    <body>
    <applet code="file:///C:/Documents and Settings/Me/Desktop/Web/HTML Development/Java/Class'/test.java" WIDTH="150" HEIGHT="25">


    </applet>
    </body>

    </html>

    but htis does not work, just gives me a grey box wit the target directory. any suggestions?
    Reply With Quote
      #2  
    Old 01-06-2005, 11:53 PM
    ray326's Avatar
    ray326 ray326 is offline
    Got Link?
     
    Join Date: Nov 2003
    Location: Jerryville, Tejas
    Posts: 11,741
    The code attribute has to point to compiled Java, either a class file or a jar or zip.
    __________________
    Help Save Ana

    Why use Web Standards: Zeldman
    How (new): Castro
    How (experienced): Cederholm
    If you can only get one book and you're already HTML savvy then this is it:
    stylin' with CSS: A Designer's Guide
    Charles Wyke-Smith
    New Riders


    "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan
    Reply With Quote
      #3  
    Old 01-07-2005, 03:18 AM
    buntine buntine is offline
    Super Moderator
     
    Join Date: Jan 2004
    Location: Melbourne, Australia
    Posts: 5,527
    Your file should be named in referance to the name of the class. So rename your file HelloWorld.java and then use HelloWorld.class in the code attribute in your HTML.
    __________________
    http://www.andrewbuntine.com
    Reply With Quote
      #4  
    Old 01-07-2005, 02:21 PM
    keko4201 keko4201 is offline
    Registered User
     
    Join Date: Aug 2004
    Posts: 61
    yea i know buntin, it was a mistake on my part for that, even if i do that, it dont work
    Reply With Quote
      #5  
    Old 01-07-2005, 07:24 PM
    buntine buntine is offline
    Super Moderator
     
    Join Date: Jan 2004
    Location: Melbourne, Australia
    Posts: 5,527
    Read this to get an overview of how Java Applets are supposed to be laid out: http://java.sun.com/docs/books/tutor...iew/index.html

    Regards.
    __________________
    http://www.andrewbuntine.com
    Reply With Quote
    Reply

    Bookmarks


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

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    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 Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 02:41 PM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.