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 04:44 PM.
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
in = new Scanner(new FileReader(FILE_NAME));
String thisLine = in.nextLine();
Scanner im = new Scanner(thisLine);
im.useDelimiter("- |, |; |\r\n");
if(thisLine.equals("") || thisLine.substring(0,2).equals("??") );
String artistName = im.next();
Artist newArtist = new Artist(artistName);
loc = im.next();
title = im.next();
size = im.next();
medium = im.next();
Painting newPainting = new Painting(artistName, loc, title, size, medium);
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
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
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
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 10:40 PM.
By Manticor in forum Java
Last Post: 05-29-2005, 01:27 AM
By Charlie Flynn in forum Java
Last Post: 08-23-2001, 11:01 AM
Last Post: 08-03-2000, 03:51 PM
Last Post: 05-06-2000, 10:38 PM
Last Post: 05-06-2000, 10:36 PM
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center