• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java applets

 
Penny Papa
Greenhorn
Posts: 24
Android Java Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!
We started at school learning java applets... and the teacher gave us a simple excercise but.... it doesn't run... I wonder what it could be wrong...
In java applets we need 2 files is that correct? 1 java file and 1 html file.. isn't it?
Here are the codes....
This is the java file

And the html file is:


So what it would be wrong?
 
Campbell Ritchie
Sheriff
Posts: 51453
87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And how are you executing that code? What instructions are you giving at the command line? We need more information than “it doesn't run”.
 
Penny Papa
Greenhorn
Posts: 24
Android Java Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:And how are you executing that code? What instructions are you giving at the command line? We need more information than “it doesn't run”.


Oh have to run it in a browser but all the browsers I used are blocking my java..
I tried to run the program in command line, but my teacher said he wants to run it in a browser..
 
Campbell Ritchie
Sheriff
Posts: 51453
87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start by running it from the command line. And tell us the instructions you are using.

There are a lot of security issues relating to applets, so many people regard them as obsolete. You would have to alter the options on your browser to permit Java applets temporarily.
 
Dave Tolls
Ranch Hand
Posts: 2112
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Start by running it from the command line. And tell us the instructions you are using.

There are a lot of security issues relating to applets, so many people regard them as obsolete. You would have to alter the options on your browser to permit Java applets temporarily.


Applets in general may or may not be obsolete, by I would think Applets most definitely are...
 
Penny Papa
Greenhorn
Posts: 24
Android Java Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Start by running it from the command line. And tell us the instructions you are using.

There are a lot of security issues relating to applets, so many people regard them as obsolete. You would have to alter the options on your browser to permit Java applets temporarily.


First I'm typing in command line the order:
javac HelloApplet.java

and it's just what I need, and it works fine to this stage.
But when I'm opening any, any browser I receive an error that my java is blocked by the browser. Really I tried this again at school and didn't work... maybe I have to put some java plugins to my browsers?
So anytime I'm making java I won't see it to my browser I'm afraid...
 
Piet Souris
Rancher
Posts: 1539
33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Penny,

just ask your teacher how to get an applet running in todays browsers. That is not
something you should be able to do.

And secondly it is not so easy to adapt the code of an applet so that you can
run it from the command line and seeing something on your screen.. Well,
not unless you know something about jframes and jpanels.

So, go to your teacher, is my advice.

Greetz,
Piet
 
Penny Papa
Greenhorn
Posts: 24
Android Java Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Piet Souris wrote:Hi Penny,

just ask your teacher how to get an applet running in todays browsers. That is not
something you should be able to do.

And secondly it is not so easy to adapt the code of an applet so that you can
run it from the command line and seeing something on your screen.. Well,
not unless you know something about jframes and jpanels.

So, go to your teacher, is my advice.

Greetz,
Piet


Thank you Piet! ;)
 
Igor Janicki
Greenhorn
Posts: 9
Eclipse IDE Firefox Browser Windows Vista
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try



without .class extension
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic