Results 1 to 4 of 4
- 09-11-2009, 07:38 PM #1
Senior Member
- Join Date
- Sep 2009
- Location
- Sweden/Borås
- Posts
- 107
- Rep Power
- 0
image problem when using any browser
Hello all. Im totally new at this forum. And just as new to Java.
This is my setup on the server.
Helloworld.class and helloworldmedia.class in same folder. I have my image in images/world.jpg. I have my sound in audio/audio.wav. this is my code.
Helloworld.class.
helloworldmedia.classJava Code:import java.applet.*; import java.awt.Graphics; public class helloworld extends Applet { public void init() { resize(200, 150); } public void paint(Graphics g) { g.drawString("hello world", 50, 100); } }
This works great when i use Appletviewer. When i use web browser the string in helloworld are the only thing showing. I have checked so that all the names on folders and path are correct. The audio works great both on viewer and online. And yes one final thing. When i scroll my browser the "hello world" dissapear.Java Code:import java.applet.*; import java.awt.*; public class helloworldmedia extends helloworld { private Image myImage; private AudioClip myAudio; public void init() { super.init(); myImage = getImage(getCodeBase(), "images/world.jpg"); myAudio = getAudioClip(getCodeBase(), "audio/audio.wav"); } public void paint(Graphics g) { g.drawImage(myImage, 0, 0, this); super.paint(g); } public void start() { myAudio.loop(); } public void stop() { myAudio.stop(); } }
/ ocean
- 09-14-2009, 09:43 PM #2
Im also new here and to java.
I tried your program with the basic html code that is..
Java Code:<html> <body> <applet code="helloworldmedia"> </applet> </body> </html>
It works fine for me everywhere.. no problems. I do not know y it is giving you problems. :(
- 09-17-2009, 09:51 PM #3
Senior Member
- Join Date
- Sep 2009
- Location
- Sweden/Borås
- Posts
- 107
- Rep Power
- 0
Must be a browser problem then. thx alot.
- 09-17-2009, 10:29 PM #4
Similar Threads
-
problem with back button of the browser.
By shivakumari in forum Java ServletReplies: 2Last Post: 03-25-2009, 07:41 AM -
Problem with applet, between appletviewer and browser
By Goodwine in forum Java AppletsReplies: 0Last Post: 11-30-2008, 03:09 AM -
restrict users from entering the image/text files path directly in the browser.
By vishnujava in forum Java ServletReplies: 6Last Post: 08-06-2008, 01:41 PM -
Problem is getting the data to browser(JSTL)
By freddieMaize in forum JavaServer Pages (JSP) and JSTLReplies: 6Last Post: 07-15-2008, 03:04 PM -
Problem is getting the data to browser
By freddieMaize in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 05-26-2008, 02:49 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks