Applying images as skins in chat applet

Hi,
I have developed chat applet. I have implemented skins in that applet. But as colors. So how to apply images as diff skins.
It is urgent.
Please be polite and answer

Good evening, sir, or madam, as the case may be,
To correctly implement this, you must first learn how to load image files into an applet. Might I be so bold as to recommend that one look at the javax.swing.ImageIcon class, as it is endowed with constructors which facilitate the loading of images via a URL.
Following that, I would then encourage you to learn how to take said loaded image and draw it on component. For this, I would recommend subclassing some component (JPanel, or some other suitable component), and override the paintComponent() method. The java.awt.Graphics class is supremely suited to perform drawing operations of this sort, as well as many others.
Once you have successfully completed these tasks, then you will find that you have an applet which one can decorated with wonderful imagery from all corners of the world.
Yours most sincerely,
bsampieri

Similar Messages

  • Image does not appear in applet.

    I am reading the book, Teach Yourself Java in 21 Days.
    There is an example in Ch.11 that shows how to load an image into the applet.
    I have tried to use the code provided as is along with an image as defined in the code. I have also uploaded the html, class and image to a folder on the web. Unfortunately, the image does not appear in the applet. The image does have an image that I created using ms paint.
    Here is the code I am currently using from the book:
    import java.awt.Graphics;
    import java.awt.Image;
    public class LadyBug2 extends java.applet.Applet {
         Image bugimg;
         public void init() {
             bugimg = getImage(getCodeBase(),
                 "ladybug.gif");
         public void paint(Graphics g) {
             int iwidth = bugimg.getWidth(this);
             int iheight = bugimg.getHeight(this);
             int xpos = 10;
             // 25 %
            g.drawImage(bugimg, xpos, 10,
                iwidth / 4, iheight / 4, this);
             // 50 %
             xpos += (iwidth / 4) + 10;
             g.drawImage(bugimg, xpos , 10,
                  iwidth / 2, iheight / 2, this);
             // 100%
             xpos += (iwidth / 2) + 10;
             g.drawImage(bugimg, xpos, 10, this);
             // 150% x, 25% y
             g.drawImage(bugimg, 10, iheight + 30,
                 (int)(iwidth * 1.5), iheight / 4, this);
    }I tried placing the image in an images folder and I also tried changing the code to getImage(getDocumentBase(), "ladybug.gif")
    as well as tried getImage(getCodeBase(), "ladybug.gif") in order to try and grab the image from the same directory as the class file and the html file.
    The image file's name is: ladybug.gif
    The code in the html file:
    <HTML>
    <HEAD>
    <TITLE>Lady Bug</TITLE>
    </HEAD>
    <BODY>
    <P>
    <APPLET CODE="LadyBug2.class" WIDTH=1024 HEIGHT=500>
    </APPLET>
    </BODY>
    </HTML>
    I have gotten previous applet examples from the book to work. One of them did have an error in the author's code which I fortunately was able to overcome. This time, I am afraid, the error eludes me.
    Thanks in advance.
    I do see that there is no start/stop/run in this version, but I believe this should still work because of the init. I am guessing that maybe the problem lies somewhere in there.
    Message was edited by:
    gnikollaj

    According to the javadoc:
    getImage
    public Image getImage(URL url,
    String name)Returns an Image object that can then be painted on the screen. The url argument must specify an absolute URL. The name argument is a specifier that is relative to the url argument.
    This method always returns immediately, whether or not the image exists. When this applet attempts to draw the image on the screen, the data will be loaded. The graphics primitives that draw the image will incrementally paint on the screen.
    Parameters:
    url - an absolute URL giving the base location of the image.
    name - the location of the image, relative to the url argument.
    Returns:
    the image at the specified URL.
    I am confused as to how to use the name after the url.
    Should it read something like:
    bugimg = getImage("http://g.jtrusty.com/JavaApplet/", "LadyBug.gif");
    EDIT: I still get the same error, cannot find symbol at getImage.
    Message was edited by:
    gnikollaj

  • How to design a chat applet?

    Hello,
    I have to design a chat applet in such a way that two users on different systems should be able to chat to each other after they login into a site. The applet should be able to save the transcript after the chat gets over (and that is considered to be done when one of the users logs out or closes the browser window).
    How do I design such an applet? Should I use sockets to enable communication between the browsers? Is there any place where I can get source code for similar applets?
    Regards,
    Arun Jayaprakash.

    The pages have to be designed in ASP. The applet should only provide the functionality of a chat room with the specifications that I had mentioned in an earlier post.
    Regards,
    Arun Jayaprakash.

  • Image does not display in Applet

    Hi people,
    I'm trying to display an image (gif image) in an applet,
    however, it does not show up when the applet is run.
    Here is my code:
    import java.applet.Applet;
    import java.awt.Graphics;
    import java.awt.Image;
    // An applet that loads an image and
    // displays it.
    public class DrawImage extends Applet
    Image image; //an 'Image' object
    //initialise applet
    public void init()
    //Load Image into object 'image'
    //URL url , String file
    image = getImage(getCodeBase(), "gifpic.gif");
    //applet's paint function
    public void paint(Graphics g)
    if(image != null)
    { //if image is found then drawImage()
    g.drawImage(image, 0, 0, this);
    else
    {     //if image is not found, then display message
    System.out.println("image not found");
    -----------------------------------------------------------------------

    Applets cannot access the system resources. To come out of the sand box of the applet you need to create policy files and certificate for the applet.
    Please refer this site for further details.
    http://java.sun.com/developer/technicalArticles/Security/Signed/
    Regards,
    EclipseOrg

  • Java Chat applet won't send messages

    So i got a brand new MacBook Air yesterday with Mac OS X 10.8.2 and installed Java 7 Update 9 from Oracle.
    When using Safari 6 i run into a problem with a browser based Java chat applet.
    First of all: Java and Javascript are actibated in Safari.
    So I go to the chat's website and start the chat.
    Java works fine at first and the chat starts.
    People can send me private messages and i can type in a reply.
    However I cannot send these replies. Neither in the private messages (applet) nor in the main chat (browser).
    Any idea how to fix this issue?
    (BTW: Java 7 was the first Java ever installed on my Air, so no going back to Apples Java 6)

    And Java 7 Update 10 did not solve the problem either.
    Can anybody offer any ideas for a solution?
    Help would be much appreciated.

  • How to activate browser(to top) whenever chat applet recieves new  message

    This is problem with Chat applet. This chat applet is placed in a web page. It is working fine with all the messages recived. But my problem is , the page(if winow is minimized)) sholud activate to top of all applications whenever applet recieves a new message .
    How can this be solved.
    Thanks

    Well, you could try getting the parent window of the applet (use getParent() till you find a Window object) and call toFront, but I don't think there's anything you can do if it's minimized.

  • Chat applet

    hello,
    i developed a chat applet using JDK 1.3 .It is a swing applet.when i compile and run the applet ,it runs well inthe appletviewer.In IE ,it shows the following error "java.lang.ClassNotFoundException: javax.swing.JApplet".I think it needs java plugin.In JDK 1.3, javaplugin is already builtin.Then why it shows the above said error?.Kindly clarify the error.THIS IS VERY URGENT.

    i also have done that type of applicaton with messenger , if you use Only Applet
    then client side browser have also java plugin in defult and suport Applet but
    if you use JApplet then u should have to use java plugin which support Swing
    at client side.
    i come at this Forum some time, if you u have any problem then u can
    contect me at [email protected]
    OK ?

  • Chat applet closes browser!!

    I'm programming a chat applet using MulticastSockets
    the connect button does something like this:
    dest = new InetSocketAddress("228.5.6.7",4321);
    try{
    socket = new MulticastSocket(4321);
    NetworkInterface netif = NetworkInterface.getByInetAddress(InetAddress.getLocalHost());
    socket.joinGroup(dest, netif);
    InetAddress address = InetAddress.getByName("228.5.6.7");
    socket.joinGroup(address);
    I also have a signed jar file so the client gives rights to the applet (so it can open the sockets)
    It works on win2k and winXP but on win98 when the client clicks the connect button the browser closes itself. I don't know what kind of error could produce this.
    Any ideas??

    In response to the original: Have you tried updated browsers on the 98 machine?
    In response to everthing else:
    If you were developing a chat application using php and javascript, I could understand using the http protocol, but if you're using an applet, why not just connect with a socket? And, for that matter, it seems fairly simple to make it peer-to-peer and just connect to whoever you want to send to.(just keep a hash of names and ip's)
    The conversation is interesting though since I've thought about the feasability of creating a php/javascript client to jabber. As far as keeping the http connection open and polling, seems like you could specify some send rate from the server side(1 packet every other second isn't the end of the world) and re-poll whenever the client hasn't received a packet for a straight 3 seconds, or something like that...
    The problem with php and javascript is that they really have funny threading and time limits(some that are server invoked), but I suppose this can be circumvented. There are loopholes.

  • How does chat applet works?

    how does chat applet works? What specific technologies should i learn to make a chat messaging work?
    thanks in advance for ur help...

    Chat applets work on sockets. Normally there are two parts. One server and one or more clients. The clients connect to the server and any message sent by a client is then distributed by the server to all the other clients.
    Sun's site is incredibly slow tonite so I'll give you a google link
    http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=chatserver+chatclient+java

  • How to apply image texture to imported shape

    This is regarding applying am image texture to an object.
    I am able to apply an image texture to a Sphere.
    Sphere mySphere = new Sphere(1.0f, Sphere.GENERATE_NORMALS | Sphere.GENERATE_TEXTURE_COORDS, 10,appear);
    objRoot.addChild(mySphere);
    But when i import a model from a file(.obj), and apply the texture to the imported objects,
    the image is not displayed as texture but a color similar to the image is displayed.
    How to apply image texture to imported objects?

    Mylenium, thanks for your response but unfortunately I'm still missing something here. I have two problems:
    1. I don't understand how to size the logo to only cover a small portion of the golf ball. Because of the other problem I'll describe in 2) below, I simplified my test by trying this on a basic PS sphere. I loaded the logo image into the diffuse texture but it wraps the sphere. I tried editing the texture thinking I could fix it by using Transform scale, but that is greyed out. So, how do I cause the logo to apply to a small portion of the surface (as a traditional golf ball logo would appear)?
    2. Perhaps the bigger issue here is when I attempt to do this with the golf ball 3ds model instead of the PS sphere, the wrapped logo appears to be sitting somewhere between the outer surface of the ball and the inner core. In other words, the wrapped logo has a very sporadic appearance where it shows up in some dimples but not others. It isn't just applying to the surface of the ball. Thinking this might have been a problem with the .3ds model I acquired an .obj golf ball from a different source but it exhibited exactly the same problem.
    I'm experienced with PS and 3D in a couple of other programs, but new to 3D in PS. I appreciate your help with this.
    Jerry

  • Apply Image to datagrid row

    hi
    i have one problem i need to apply image to selected row in
    datagrid dynamically we have
    "selectedcolor" but i need to apply image to selected row is
    there any way please help me
    client requires this effect
    karthik.k

    hi thanks for the reply i am posting sample code
    <DataGrid id="dg_getData1" backgroundColor="0x87A3B7"
    selectionColor="0xE4C38D" verticalScrollPolicy="off"
    horizontalScrollPolicy="off" itemClick="getIdForPresenter()"
    wordWrap="true" width="100%" verticalGridLines="false"
    backgroundAlpha="0.3" headerHeight="0" fontSize="20" rowHeight="53"
    dataProvider="{model.filteredCollection}" useRollOver="false"
    horizontalGridLineColor="0xFFFFFF" horizontalGridLines="true">
    <columns>
    <DataGridColumn width="30" dataField="sessionTimes" >
    <itemRenderer>
    <Component>
    <HBox horizontalScrollPolicy="off">
    <Script>
    <![CDATA[
    import mx.controls.Alert;
    override public function set data(value:Object):void
    var s_String1:String;
    var s_String2:String;
    var s_String3:String;
    var num:Number
    super.data=value;
    s_String1=sessionTimes.text;
    var arr_Array:Array=s_String1.split(" /");
    for(var i:int;i<arr_Array.length;i++)
    s_String3=arr_Array[0]
    sessionTime.text=s_String3
    s_String2=arr_Array[1];
    /* num=arr_Array[2]
    if(num%2==0)
    setStyle("backgroundColor",0x8EA9BB);
    else
    setStyle("backgroundColor",0x6B8FAB);
    if(s_String2=="NOT RECEIVED")
    sessionTime.styleName='textcolor';
    else
    sessionTime.styleName='textcolor1';
    ]]>
    </Script>
    <Label id="sessionTime" />
    <Text id="sessionTimes" text="{data.sessionTimes}"
    visible="false"/>
    </HBox>
    </Component></itemRenderer>
    </DataGridColumn>
    </DataGrid>
    i am using itemrenderer i need to place an image and when
    that row is clicked i need to display image for the row clicked and
    when next row clicked previously clicked image should disappear and
    currently clicked row should be displayed with image(every thing
    dynamically)
    only option i saw is "selectionColor="0xE4C38D" but i don't
    know how to place image instead of "selectionColor" for button we
    have style effect (upskin, downskin) where we can embed image but
    in datagrid any option like that,
    any idea this requirement is severe
    please help me
    karthik

  • Firefox not loading Orkut chat applet while IE or Chrome does.

    Firefox is not able to load Orkut chat applet.
    It loads Gmail and all other sites of Google properly.
    Even it is able to load Chat in Gmail but unable to do so in Orkut.
    In addition to that Internet Download Manager is not functioning since I upgraded to 3.6
    Earlier version 3.5 was working perfect with all apps and websites.
    Please look in to this as Firefox is losing a substantial fan-base due to failure to load most popular websites and support auto download from websites.
    Thanks

    I am constantly using Private Browsing.
    Please let me know if this is a reason for the problem

  • Photoshop CS4 Channel  Apply Image

         Good evening, everybody. I am a beginner of Photoshop and I am really interested in Photoshop.
         Here is a big challenge I have met in the "Image>Apply Image..."
         As it's shown in the picture, I use the Channel Alpha1 to alter the RGB Compound Channel and the Blending mode is ADD. And I can understand the fundamental of the above operation. Then question occur:
        I don't get a full understanding of the Chek Box "Mask..."  and I don't konw what it is used for. And what about some parameters "Image", "Channel", "Layser" about the "Mask..." Can you explain the secret of it to me? It will be much better if you could give me the fundamental or algorithm of it.
        I will really appreciate your reply.
                                                                                                                   -----From a Ps Loyal fans

    c.pfaffenbichler wrote:
    Do you follow some course?
    Because in practice this feature seems to hardly get used by most people.
    The Apply Image feature is used in fashion portrait retouching when the frequency separation technique is employed. This technique separates texture and color into two layers, which are edited separately. There are several video tutorials showing how it is done, but none of them gets into the details of the Apply Image settings. They just show you what numbers to stick in a few of the boxes. I, too, would like to know more about what those settings do.
    An example of one such tutorial is here: http://fstoppers.com/frequency-separation-with-fashion-photographer-retoucher-elena-jasic

  • Apply image with smart object?

    What is the trick to be able to use "apply image" to a smart object? If not can someone explain the logic? Thanks

    Can't yet.

  • Problem loading the chat applet, red x mark sign..

    Hello all - hopefully this is the correct place for this post. I've been trying to load a java enabled chat room, and keep getting a red X in the top left corner (java applet failed, etc).
    Java chat applet fails to load in the following website www.chat-web.com, but loads in the other websites. the following is the version i have installed in my computer. Version 6 Update 12 (build 1.6.0_12-b04). I have visited the help section of the website in which java applet fails to load and tried all the following steps,
    1) I cleared all the temp files from the internet options.
    2) cleared the cache in the java plug-in
    3) disabled the pop-up blocker
    insipite of the above steps the problem still persists..
    here is a screen shot of the error > http://i42.tinypic.com/2pzwhvp.jpg
    here is the details of the error :
    Java Plug-in 1.6.0_12
    Using JRE version 1.6.0_12 Java HotSpot(TM) Client VM
    User home directory = C:\Users\Guest
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    load: class com.chatspace.v20090.Chat not found.
    java.lang.ClassNotFoundException: com.chatspace.v20090.Chat
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.net.ConnectException: Connection timed out: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(Unknown Source)
         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.SocksSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at sun.net.NetworkClient.doConnect(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.http.HttpClient.<init>(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
         at java.net.HttpURLConnection.getResponseCode(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 7 more
    Exception: java.lang.ClassNotFoundException: com.chatspace.v20090.Chat
    Does this look like a chat room error? I think my side is fine, but I could be wrong. I'm not the best technical person, but just know the basics.
    Anyone have any ideas?
    Thanks!
    livelife

    Hi. Thank you for reply. I tried the steps suggested by you, but it still shows the same errors, i e-mailed to chat-web.com as well but seems the e-mail is invalid. i tried to load the chat rooms in my desktop pc too, i get the same error,
    Java Plug-in 1.6.0_13
    Using JRE version 1.6.0_13 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\Intel
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    load: class com.chatspace.v20090.Chat not found.
    java.lang.ClassNotFoundException: com.chatspace.v20090.Chat
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.net.SocketException: Network is unreachable: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(Unknown Source)
         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.SocksSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at sun.net.NetworkClient.doConnect(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.http.HttpClient.<init>(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
         at java.net.HttpURLConnection.getResponseCode(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 7 more
    Exception: java.lang.ClassNotFoundException: com.chatspace.v20090.Chat
    lifelive

Maybe you are looking for

  • Lc8901a(Gpib) and 3512(ADC) fast polling repost. Labwindows CVI(on a win98 machine)

    Okies I made a this lowlevel try to get a controlled poll. I only pull 2 bytes but still its slow(around 60 polls per second). I also made some attempts with the IVI driver, which isn't workin that good either. mabe i'm doing things in the wrong orde

  • Nokia 5800 and GPS

    I have  nokia 5800 I try to do mapping by using GPS anyone have way to resolve this troubleshooting

  • How to Upload photos from touch on Ipad to PC

    Hi, i have photoshop touch on my ipad and am trying to get the photos from photoshop touch from my ipad onto my computer running windows vista.  Apparaently you select the photos in photoshop touch and use the option "copy to itunes", then it says it

  • What is "most recent new" update option?

    When I am setting up what podcasts will sync to my iPhone I get these 4 basic options.... 1. "most recent" 2. "most recent unplayed" 3. "least recent unplayed" 4. "most recent new" I cannot for the life of me figure out what "most recent new" does. A

  • What is an OSStatus error -49

    We are using Roxio Easy VHS to DVD for Mac and it works fine until we try to record more than a couple of minutes of tape.  Several times we have let the whole tape run and it records it but when we stop the recording and finish we get the message: "