IE says that my applet can't be instantiated
Okay, the applet I've made can be viewed by the appletviewer whereas IE says it can't be instantiated. Is there a problem with regards to inheritance? I've tried using javac -target 1.1 to compile the code and it still didn't work. It does work for my other applets.
I'm posting the codes for the html and the two files I've made.
listapplet.html<html>
<head>
<title>List Applet</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000" background="bbg.jpg">
<applet code="ListApplet.class" width="994" height="67">
</applet>
</body>
</html>
ListApplet.java
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
public class ListApplet extends Applet implements ItemListener{
MyList lstsample=new MyList();
Label lblsample=new Label();
public void init(){
setLayout(new GridLayout(2,1));
lstsample.addItemListener(this);
add(lstsample);
add(lblsample);
public void itemStateChanged(ItemEvent ie){
if(ie.getSource()==lstsample){
lblsample.setText("You have chosen"+ lstsample.getSelectedItem());
MyList.java
import java.awt.*;
public class MyList extends List{
String[] str={"Migs", "Myles", "Jet", "Lans", "Tins", "Liz"};
MyList(){
for(int i=0;i<str.length;i++){
this.add(str);
Errmmm... errors?
How could it have errors when it runs perfectly well with appletviewer? I used the modification you suggested and it did run using appletviewer.
Better yet, it can be compiled by java. I don't think there are errors, really since that kind of error you stated I feel should be found by the Java compiler, that's where I usually encounter such errors.
I'm not really sure if it's how I compiled it(Since somebody told me to compile it using javac -target 1.1 ArchiveName.java and it worked on my other projects that don't have inheritance and uses other classes) I really don't have an idea if it was compiled using 1.1 JVM since I only mostly know the principles of Java and not exactly the more advanced parts.
Besides MyList.java:9 reads like this
this.add(str);
the value i indicates an integer.
So it's not a String array rather a String object. Maybe something wrong with my post?
Similar Messages
-
I need to take a picture of a web page, insert it onto a powerpoint online, and crop the picture. I am pressing the print screen button, and right cliking paste. But I am getting the warning message saying that my browser can not use the clipboard, and I am unsure of how to take a picture, then paste it, and crop it all on to a power point.
http://portableapps.com/apps/internet/firefox_portable/localization#legacy36
-
Hi i have an ipod 4th gen. the problem is when ever i try to sync my iPod to my computer a mesage comes up and says that the ipod can't be backed up. There wasn't a problem until I upgraded the software. How do I fix this??
Try here:
iOS: Troubleshooting backup issues in iTunes -
ever since i forgot my apple id password and changed to a new one, I am continually being asked to enter my iCloud password. It then says that this mac can't connect to iCloud because of a problem with "my username". nothing I do in in preferences helps.
You have to sign out completely in System Preference>iCloud (click 'Sign out') on a Mac, or Settings>iCloud on an iOS device (click 'Delete account' - this will not delete the account from the server). Then sign in with the new password.
Your iCloud data will disappear from your Mac or device when you sign out but will reappear when you sign back in. -
Keeping getting an error with-in the App Store. Error 100 saying that my payment can't be received at the time. I updated to Mountain Lion to download the new Logic Pro X. Now left with now recording software and it's not letting me buy the new one.
iMac, OS X Mountain Lion (10.8.4), trying to get Logic Pro XHello jst84,
The following article may be helpful in getting your purchase to complete.
Mac App Store: "An unknown error occurred (100)" when purchasing
http://support.apple.com/kb/TS3637
Cheers,
Allen -
I just purchased the new Canon SX60 camera. Despite downloading and installing the latest version of Adobe DNG converter, I receive an error message saying that Photoshop CS4 can't open up/convert raw files (.CR2). This is the same file format as used by the SX50, with which I never had any problem. Does anyone have a suggestion on how to fix this problem? Thanks.
Camera Raw plug-in | Supported cameras I do not see that SX60 as supported. Just how new is the SX60 when was it announces. Its support is not even listed in ACR 8.7 RC
-
After using my browser (any of them) for a period of time I get a message saying that a page can't be opened. I have to reboot again. Clearing the cache doesn't help. It's very annoying. It even happened in the middle of a chat with Apple online support. I'd be very grateful for help!
Several things come to mind ... when you say your wife uses the same system with a different login and doesn't have issues, that suggests looking at your login items. Go to System Preferences (on your dock or on your hard drive in Applications), accounts, and on your account look at login items. Anything there that shouldn't be or isn't used? If you don't know, create a new account for yourself with no login items, and see if you still have the issue.
Next, I would run OnyX, which is a free disk maintenance program. You can download it from http://www.titanium.free.fr/download.php . Do the tasks on the cleaning and maintenance tabs. Before using any disk maintenance software, you should have a system backup. I periodically run it, and others have found that it can help with performance.
You might look at how you're system is using memory. You should have enough but it's easy to check. Bring up the Activity Monitor (on your hard drive in Applications/Utilities), and look at the system memory tab. Note page ins and page outs. If page outs are 10% to 15% more than page ins, you can use more memory for the programs you run. A page out occurs when memory is full and OS X has to write a section of memory to the hard drive. Too much of this can really impact performance. The optimal situation is for page outs to be zero. Note these values reset on a system boot. -
When I try to download the 10.0 update, my computer says that this, "URL can not be downloaded."
Order a 10.6 disc from Apple online. They do not sell it in their retail stores.
Snow Leopard disc source - http://store.apple.com/us/product/MC573Z/A/mac-os-x-106-snow-leopard
Back up your computer first. After installing, run Software Update to update everything to the newest versions available.
Check your computer's system specifications but you may have the option for a free upgrade/update to OSX 10.9 Mavericks, though you may want to stick with 10.6 for a while. Higher systems usually run slower on older machines and I personally would stay with Snow Leopard until I was forced to change again. -
I bought the song say something and it tried to download and it's in my library and I can play it but it has that little cloud thing beside it and when I tap it, it says that the done can't be downloaded at this time. How can I get it to download? It's been like this for a couple weeks.
You can download it on your computer at no extra charge and then sync it to your ipod
-
When I try to launch iTunes is says that the application can not be opened
When I try to open iTunes it says that the application can not be opened, that the required folder can not be found. On my husbands log-on iTunes will open. I am so confused. Please help!!!
Hello Keaton44,
I recommend taking a look at this article named iTunes: Finding lost media and downloads found here http://support.apple.com/kb/ts1408
If you need to re download the movies you bought from iTunes you can do that free of charge with this article.
Downloading past purchases from the App Store, iBookstore, and iTunes Store
http://support.apple.com/kb/ht2519
Regards,
Sterling -
I have accidentally deleted off my Mac a preferences file for Adobe photoshop and now the program cannot initialize. I have talked to Apple and then say that if Adobe can isolate the file they can help me restore it from my time machine. How do I isolate the file ?
Do you have the path to this file and name of this file?
-
I get a 404 error when accessing my website which is supported by Apple. The message says that the server can't find my page. My browser is Safari. How can I fix the problem when it failed just today?
If you uploaded to MobileMe, it's no longer available. Apple's closed MobileMe and stopped offering web hosting.
(116252) -
I get a 404 error when accessing my website which is supported by Apple. The message says that the server can't find my page. My browser is Safari. How can I fix this?
If you uploaded to MobileMe, it's no longer available. Apple's closed MobileMe and stopped offering web hosting.
(116252) -
When i try to backup my iPod - says that "my computer can't save backup"
when i try to backup my iPod - says that "my computer can't save backup"
See iTunes: "Backup could not be saved on the computer" alert message, http://support.apple.com/kb/ts2529
-
I am from russia and i cant understand why my iphone 4g(black) can not sync..The computer gives an error saying that the synchronization can not be executed because you can not save a copy ... What should I do?
Hey joshuafromisr,
If you resintall iTunes, it should fix the issue. The following document will go over how to remove iTunes fully and then reinstall. Depending on what version of Windows you're running you'll either follow the directions here:
Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
http://support.apple.com/kb/HT1925
or here:
Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
http://support.apple.com/kb/HT1923
Best,
David
Maybe you are looking for
-
How do u transfer pictures/tunes from 4 year old mac to new mac
how do u transfer pictures/tunes from 4 year old mac to new mac ?
-
UWL: headerless portal window launches with improper column justification
Hello, We are running Portal 7.0, for our ECC 5.0 and SRM 4.0 production systems. When managers execute an item from their Universal Worklist, such as an absence notification, a new headerless portal window is launched. All of the viewable data sho
-
Rounding differences in GR/IR clearing
Hi all In Gr/IR clearing few items are not getting cleared becasue of difference of 0.01 in LC between GR and IR. Although both GR and IR take place in the same month ( and hence gets translated at the same forex rate) the GR is say 152.11 and IR is
-
Adobe Action: Save As JPEG, but stop to let me change the file name?
I'm needing to save about 100 different JPEG files based on one template with differing text in each JPEG. I've got my layers set up with a template behind, and all 100 text layers on top of each other. So I turn the text layers on one at a time and
-
We created external user in Irec. Username created successfully and following responsibility is assigned to him by system. iRecruitment External Candidate Now I try to log in with this username/password. After entering username/password of external c