• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

PNG Files

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The below code displays JPG,BMP,GIF files but when it comes to PNG (or) WMF files the applet does not display the image Why ???
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.net.*;

public class Applet_mp extends Applet {
Image background;
public void init() {
URL codeBase = getCodeBase();
background = getImage(codeBase,"mp_j.jpg");
}
public void paint(Graphics g) {
g.drawImage(background,0,0,this);
}
}
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I replied to this question in Intermediate section -- You like to multi post you question. right? Here is the answer I have given:
By default Java supports only GIF, JPG and BMP. If you want to support other image files you have to download Media frame works package (available at java.sun.com) -- I have never used that before
Hope it helps --
------------------
Hari Gangadharan
Out of the turbulance a soft voice spoke to me ...
Son smile and be happy things could be worse...
I smiled and I was happy and things became worse!
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please do not post the same question in more than one forum. You obviously read more than one forum, and so do the people who might take the time to answer your question.
This thread has been closed. All replies to the one in "Java in General (intermediate)".
 
I am not a spy. Definitely. Definitely not a spy. Not me. No way. But this tiny ad ...
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic