applet problems on webpage????


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: applet problems on webpage????

  1. #1
    Join Date
    Aug 2006
    Posts
    7

    applet problems on webpage????

    Hi, I know what I'm doing for the most part with java, but when I tried to load my applet onto the webpage I've been working on for this lady (click on artwork), it doesn't load (even though it looks perfect if I run with the appletviewer). It is supposed to be a picture viewer that takes random paintings and does a nice dissolve effect in between. I think that the problem is that I need to load information for each pic from a txt file. You know for title, size,etc.. Please help!

    [EDIT] I did read something about java securities and txt files. Do I need to make the txt file into a URL and get the document base then read it in?? Well I guess I'll try it
    Last edited by osirisboy212; 08-01-2006 at 05:44 PM.

  2. #2
    Join Date
    Aug 2006
    Posts
    7
    here's the segment of code that I think is causing the issues in the browser. The actual processing of the txt file is correct so don't worry about that. I'll submit more of my code if its necessary

    try
    {
    in = new Scanner(new FileReader(FILE_NAME));
    while(in.hasNext())
    {
    String thisLine = in.nextLine();
    Scanner im = new Scanner(thisLine);
    im.useDelimiter("- |, |; |\r\n");
    if(thisLine.equals("") || thisLine.substring(0,2).equals("??") );
    else
    {
    String artistName = im.next();
    Artist newArtist = new Artist(artistName);
    while(im.hasNext())
    {
    String loc;
    String title;
    String size;
    String medium;
    loc = im.next();
    title = im.next();
    size = im.next();
    medium = im.next();
    Painting newPainting = new Painting(artistName, loc, title, size, medium);
    newArtist.addPainting(newPainting);
    }
    artists.add(newArtist);
    }

  3. #3
    Join Date
    Aug 2006
    Posts
    7
    ok well never mind I figured it out myself. If however I want to have my applet run on older browserswith older versions of the java jre, do I need to compile the files with an older version of java as well or is there some short cut to do it with current java 1.5

  4. #4
    Join Date
    Jan 2006
    Location
    Ireland
    Posts
    35
    It sounds like some of your code is only supported by Java version 1.5, hence your problems when running your applet on older browsers. I dont think you can simply recompile with an older compiler. Your only options are ...

    a. Encourage your users to download the latest version of JRE
    b. Recode your applet using code that is compatible with older versions of java

  5. #5
    Join Date
    Aug 2006
    Posts
    7

    really interesting problems

    alright well I got it working for java versions 1.4 and up for now, but I'm noticiing some inconsistencies between 1.5 and 1.4. On the java 1.5 jre it displays everything perfectly as it should and I couldn't be happier. On Java 1.4 about half of the pictures I display (I'm doing a slide show of sorts) don't show up, although their titles do. Anyone have any ideas?? Up until now I at least had theories... Thanks.
    you can check it out at http://artliaisons.com under artwork

  6. #6
    Join Date
    Aug 2006
    Posts
    7
    ok nevermind I figured it out, but just for everyone to know: java 1.4 and lower don't support image file names with spaces in them (off of servers at any rate, they do work in the applet viewer oddly enough). java 1.5 is cool with file names with spaces in them though. Problem solved
    Last edited by osirisboy212; 08-07-2006 at 11:40 PM.

Similar Threads

  1. Problems getting an Applet to run off ftp
    By Manticor in forum Java
    Replies: 2
    Last Post: 05-29-2005, 02:27 AM
  2. Replies: 3
    Last Post: 08-23-2001, 12:01 PM
  3. Applet Scrolling problems
    By hh in forum Java
    Replies: 0
    Last Post: 08-03-2000, 04:51 PM
  4. applet and thread problems
    By aneesha in forum Java
    Replies: 0
    Last Post: 05-06-2000, 11:38 PM
  5. Applet and thread problems
    By Aneesha in forum Java
    Replies: 0
    Last Post: 05-06-2000, 11:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center