Designing a chat system

hi
im trying to design a chat system that will be used in chat.class and i dont know where to start about learning how to desgin a chat system. i dont need it to use a pop up i would have to run on the main applet any help.. ehh sorry

eg #1
http://forum.java.sun.com/thread.jspa?forumID=31&start=0&threadID=287509&range=100

Similar Messages

  • Help me to design a chat system

    hello
    i am trying to develop a chat system to deploy it on the web .but i am facing a lot of difficulty in dessigning the chat server and client.
    i have seen the chat implementation in www.javaword.com article .the client initially establishes connection to the server while sending message the server receiving the message gives an EOFException.
    pls tell me shall i
    1)write the chat server in servelet or in pure java
    2)how to pass the message to the server (IOStream or ServeletIostream
    pls help me .if any of you have done this pls let me know how you have done .
    thanking you
    krishna murthy .u.

    See my Chat.
    http://es.geocities.com/fjsrey/files/IRC/download.htm

  • 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.

  • Double Billing and no help from the Chat System

    For 12 months now I've been billed for 2 accounts. I contacted the chat system about this and I was told that while her terminal couldn't fix it she would have someone else contact me later about canceling the one account without getting penalized for canceling that account early. I was in on the ground floor with the Creative Cloud and got the first 12 months at 30.00. It looks like to me when they bumped me to the 50.00 a month they didn't just change my one account but just created another under my email and started billing me for both.
    "Sharan: This subscription cancellation case will be forwarded and you will receive email within 2-3 business days regarding the same." Is what I was told in case # 0211874112.
    But what I got in an email from Adobe is this.
    "With this response, we believe your issue is resolved and have therefore closed your case 0211874112.  If your support case has not been completed to your satisfaction or you should you need to contact us on this issue again, please reference your case number. You can reopen your case up to 14 days after it has been closed."
    It wasn't closed, nothing is resolved.
    HELP PLEASE! This is getting ridiculous, I'm a small business and I don't need to be blowing my time on trying to get a big company to stop stealing from me.
    Stealing my time and money and this point.
    -Russell

    So far the answer is "we can't do anything wrong, we are Adobe" followed up with "your an idiot and if you keep bothering us we're just going to keep charging you"
    How does such amazing software have such utter failuers in the field of support.

  • Chat System: ConnectException: Connection timed out: connect

    Hi There,
    I am developing a chat system as part of a University project.
    To explain what I have implemented:
    I have three java classes;
    1. Chat Server class which is constantly listening for incoming socket connection on a particular socket:
    while (true)
    Socket client = server.accept ();
    System.out.println ("Accepted from " + client.getInetAddress ());
    ChatHandler c = new ChatHandler (client);
    c.start ();
    2. Chat Handler class uses a thread for each client to handle multiple clients:
    public ChatHandler (Socket s) throws IOException
    this.s = s;
    i = new DataInputStream (new BufferedInputStream (s.getInputStream ()));
    o = new DataOutputStream (new BufferedOutputStream (s.getOutputStream ()));
    public void run ()
    try
    handlers.addElement (this);
    while (true)
    String msg = i.readUTF ();
    broadcast (msg);
    catch (IOException ex)
    ex.printStackTrace ();
    finally
    handlers.removeElement (this);
    try
    s.close ();
    catch (IOException ex)
    ex.printStackTrace();
    protected static void broadcast (String message)
    synchronized (handlers)
    Enumeration e = handlers.elements ();
    while (e.hasMoreElements ())
    ChatHandler c = (ChatHandler) e.nextElement ();
    try
    synchronized (c.o)
    c.o.writeUTF (message);
    c.o.flush ();
    catch (IOException ex)
    c.stop ();
    3. Chat Client class which has a simple GUI and sends messages to the server to be broadcasted to all other clients on the same socket port:
    public ChatClient (String title, InputStream i, OutputStream o)
    super (title);
    this.i = new DataInputStream (new BufferedInputStream (i));
    this.o = new DataOutputStream (new BufferedOutputStream (o));
    setLayout (new BorderLayout ());
    add ("Center", output = new TextArea ());
    output.setEditable (false);
    add ("South", input = new TextField ());
    pack ();
    show ();
    input.requestFocus ();
    listener = new Thread (this);
    listener.start ();
    public void run ()
    try
    while (true)
    String line = i.readUTF ();
    output.appendText (line + "\n");
    catch (IOException ex)
    ex.printStackTrace ();
    finally
    listener = null;
    input.hide ();
    validate ();
    try
    o.close ();
    catch (IOException ex)
    ex.printStackTrace ();
    public boolean handleEvent (Event e)
    if ((e.target == input) && (e.id == Event.ACTION_EVENT)) {
    try {
    o.writeUTF ((String) e.arg);
    o.flush ();
    } catch (IOException ex) {
    ex.printStackTrace();
    listener.stop ();
    input.setText ("");
    return true;
    } else if ((e.target == this) && (e.id == Event.WINDOW_DESTROY)) {
    if (listener != null)
    listener.stop ();
    hide ();
    return true;
    return super.handleEvent (e);
    public static void main (String args[]) throws IOException
    Socket s = new Socket ("192.168.2.3",4449);
    new ChatClient ("Chat test", s.getInputStream (), s.getOutputStream ());
    On testing this simple app on my local host I have launched several instances of ChatClient and they interact perfectly between each other.
    Although when i test this app by launching ChatClient on another machine (using a wi-fi network connection at home), on the other machine that tries to connect to the hosting server (my machine) i get a "connection timed out" on the chatClient machine.
    I have added the port and ip addresses in concern to the exceptions to by-pass the firewall but i am still getting the timeout.
    Any suggestions?
    Thanks!

    Format your code with [ code ] tag pair.
    If you are a young university student I don't understand why current your code uses so many of
    too-too-too old APIs including deprecated ones.
    For example, DataInput/OutputStream should never be used for text I/Os because they aren't
    always reliable.
    Use Writers and Readers in modern Java programming
    Here's a simple and standard chat program example:
    (A few of obsolete APIs from your code remain here, but they are no problem.
    Tested both on localhost and a LAN.)
    /* ChatServer.java */
    import java.io.*;
    import java.util.*;
    import java.net.*;
    public class ChatServer{
      ServerSocket server;
      public ChatServer(){
        try{
          server = new ServerSocket(4449);
          while (true){
            Socket client = server.accept();
            System.out.println("Accepted from " + client.getInetAddress());
            ChatHandler c = new ChatHandler(client);
            c.start ();
        catch (IOException e){
          e.printStackTrace();
      public static void main(String[] args){
        new ChatServer();
    class ChatHandler extends Thread{
      static Vector<ChatHandler> handlers = new Vector<ChatHandler>();
      Socket s;
      BufferedReader i;
      PrintWriter o;
      public ChatHandler(Socket s) throws IOException{
        this.s = s;
        i = new BufferedReader(new InputStreamReader(s.getInputStream()));
        o = new PrintWriter
         (new BufferedWriter(new OutputStreamWriter(s.getOutputStream())));
      public void run(){
        try{
          handlers.addElement(this);
          while (true){
            String msg = i.readLine();
            broadcast(msg);
        catch (IOException ex){
          ex.printStackTrace();
        finally{
          handlers.removeElement(this);
          try{
            s.close();
          catch (IOException e){
            e.printStackTrace();
      protected static void broadcast(String message){
        synchronized (handlers){
          Enumeration e = handlers.elements();
          while (e.hasMoreElements()){
            ChatHandler c = (ChatHandler)(e.nextElement());
            synchronized (c.o){
              c.o.println(message);
              c.o.flush();
    /* ChatClient.java */
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    public class ChatClient extends JFrame implements Runnable{
      Socket socket;
      JTextArea output;
      JTextField input;
      BufferedReader i;
      PrintWriter o;
      Thread listener;
      JButton endButton;
      public ChatClient (String title, Socket s){
        super(title);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        socket = s;
        try{
          i = new BufferedReader(new InputStreamReader(s.getInputStream()));
          o = new PrintWriter
           (new BufferedWriter(new OutputStreamWriter(s.getOutputStream())));
        catch (IOException ie){
          ie.printStackTrace();
        Container con = getContentPane();
        con.add (output = new JTextArea(), BorderLayout.CENTER);
        output.setEditable(false);
        con.add(input = new JTextField(), BorderLayout.SOUTH);
        con.add(endButton = new JButton("END"), BorderLayout.NORTH);
        input.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent ae){
            o.println(input.getText());
            o.flush();
            input.setText("");
        endButton.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent ev){
            try{
              socket.close();
            catch (IOException ie){
              ie.printStackTrace();
            System.exit(0);
        setBounds(50, 50, 500, 500);
        setVisible(true);
        input.requestFocusInWindow();
        listener = new Thread(this);
        listener.start();
      public void run(){
        try{
          while (true){
            String line = i.readLine();
            output.append(line + "\n");
        catch (IOException ex){
          ex.printStackTrace();
        finally{
          o.close();
      public static void main (String args[]) throws IOException{
        Socket sock = null;
        String addr = "127.0.0.1";
        if (args.length > 0){
          addr = args[0];
        sock = new Socket(addr, 4449);
        new ChatClient("Chat Client", sock);
    }

  • Designing a routing system

    Hi...
    I'm trying to design a routing system for a food factory. There are 3 procssing machines, and 2 packing machines.
    Food is moved along 'queues', and the routing system accepts food from a processing machine, it then asks the packing machine 'which is the shortest queue', and gives the food to that machine.
    The machines are in charge of interacting with the queues, The routing system only deals with the machines. I've created an array of only two packing machines in the constructor, and have just on method called run, which will deal with the rest.
    the class simply needs to have a method that accepts object, and then it simply asks each machine how long the queue is and puts this object onto the shortest.
    I'm having trouble getting started on this, and would appreciate any help.
    Cheers

    In a similar vein:
    public class machine {
       Queue q;
       String name;
       public Machine( String name ) {
          q = new Queue();
          this.name = name
    }and...
    public class packingMachine extends machine {
       public packingMachine( String name ) {
          Super( name );
    }and since a Queue object can be implemented as a Vector, a linked list, an array... I will leave it up to you to decide what's the best way to create a Queue object.

  • Developing a Chat System

    Okay, so I want to develop a chat system much like AIM. I have a few problems: Even though I believe that Java is the best language for something like this, the server I am working on doesn't support it. I can only run PHP and CGI scripts. Is there a way to do this with only PHP or CGI?
    Here are a few of my ideas:
    Create either a JAVA applet or a JAVA downloaded program that users can use to chat. When they log in, they call a CGI or PHP script that places their username and IP address into a database. They can query the database to see who else is logged in and then create a direct P2P connection using that IP address. Nice? The problems: Can JAVA applets interact that way? If not, it would have to be a JAVA program that is downloaded. The disadvantages of that are obvious. Also, in order to keep a running list of online users, the program would have to query the script constantly. That would severely bog down the server. My only other option is to have users blindly IM users and if they're on, they're on. if not, they're not. That's not user-friendly at all.
    What do you guys suggest? I need help on this asap.

    Hi threre,
    I think that the only "problem" in a P2P chat system is the IP exchange. This is the only reason why a server is needed. You can create the program in java whithout problem. The program will accept the IP somehow and start. This "somehow" will depend on the server. So imho it shouldn't be intergrated in the main program.
    Also, an Applet is running on the local computer, so the IP will be the local user's IP. That means there is no problem.
    I have no idea about php and cgi, so i can't help you on the IP-exchange system.
    CU

  • Since the Adobe "Chat" system is not very responsive they suggest I ask the community my question. Did they jump you monthly fee $10 without explanation? Check your credit card.

    Since the Adobe "Chat" system is not very responsive they suggest I ask the community my question. Did they jump you monthly fee $10 without explanation? Check your credit card.
    Perhaps they will answer now?

    I remember when Adobe Customer Support existed.  Weren't those the good ole days.  Now they've pawned us off on one another.  Apparently this is what we can expect from Adobe from this point forward.

  • Help needed to design Greenhouse control system

    Has anyone designed a complete system with weather station, nutrient mixing etc

    Kahlid,
    I would appreciate some help with my greenhouse.  I'm just getting ready to design a small facility to learn on.  I have a lot of LV experience and want to use that to build an automated greenhouse for house plants.  Any help or info on where to obtain some help would be greatly appreciated.
    Thanks,
    Hal Curling

  • Blackberry IM chat system App

    Does anyone know if there is an iPhone App which is compatible with the blackberry chat system and can use the blackberry users pin no to identify them and chat?
    You would have thought Blackberry or RIM or whoever the company is would cease the opportunity to write an app to do this. I would pay for such an app. I'm sure many many iPhone users would pay good money for such an app to be able to talk to their die hard blackberry colleagues, friends, families and co- workers. Would be a good income stream for them.

    Interesting theory and observation. Thanks for pointing that out. I had not given a thought to that side of it.
    As a consumer I wasn't aware that it would be so expensive for Blackberry to re-route their Blackberry Chat IMs to another system. Also, as a consumer I suppose I don't care too much about how it is done. I'm just frustrated with how many different IM services there are and am keen to use applications which bring them together.
    To answer your question, nothing. I would not be prepared to pay a monthly fee for such a service. Why would I? I already pay a monthly fee for more SMS than I use each month. I also pay a number of monthly fees for Internet access over wifi, broadband, and mobile data plans. This is one of the reasons why I don't like paying so much for SMS. Also IM is better.
    However, I would pay for apps which consolidate IM services. I would pay up to £40 for an app which enabled IM on my iPhone to talk to the Blackberry Chat IM users. This is where they could get their revenue from. Whether or not it's enough, I don't know. But I can't imagine it would cost that much to ling their current service with an existing Web based IM service. Having said that, I am just a consumer and user of iPhone and a fre IM services such as Skype, MSN, iChat, Whats App (whatever that uses?) and apps like Ping.
    Additionally, I reckon more revenue would also come from the continued use and sales of Blackberry devises. A lot of users and businesses prefer them. If they were more useful, as in they could use the BB chat to IM iPhone users etc sales and Market share would benefit too. IMHO.

  • DW Chat System

    Hi All -
    I'm looking for a chat systems to integrate in to my site.
    It's going to be
    used as a payable advice tool, i.e. A customer could gain
    advice from an
    operator through the chat system, but would be charged for
    the service. The
    payment could be taken through PayPal or/and similar payment
    methods.
    Has anyone come accross such a thing? Even better if it were
    a Dreamweaver
    Extension.
    Thank in Advance
    andy

    Hi Murray -
    Yeah just doing a search now. Thought someone may have used
    one with DW.
    Thanks
    Andy
    "Murray *ACE*" <[email protected]> wrote
    in message
    news:gplh1c$erd$[email protected]..
    > Did you try google? There are plenty of 3rd-party apps
    out there....
    >
    > --
    > Murray --- ICQ 71997575
    > Adobe Community Expert
    > (If you *MUST* email me, don't LAUGH when you do so!)
    > ==================
    >
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    >
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    > ==================
    >
    >
    > "Andy" <[email protected]> wrote in message
    > news:gpl9gs$6en$[email protected]..
    >> Hi All -
    >> I'm looking for a chat systems to integrate in to my
    site. It's going to
    >> be used as a payable advice tool, i.e. A customer
    could gain advice from
    >> an operator through the chat system, but would be
    charged for the
    >> service. The payment could be taken through PayPal
    or/and similar payment
    >> methods.
    >> Has anyone come accross such a thing? Even better if
    it were a
    >> Dreamweaver Extension.
    >>
    >> Thank in Advance
    >> andy
    >>
    >

  • A chat system.

    i am trying to build a chat system CLI, the system consist of 3 units , the client wich send messages, the server which receives and displays the mesages with the senders, and an authentication server. wud it be feasible if i write one whole program and uses the CLI to run which unit i like.
    your advice and comment is hihly welcomed.
    thankz

    any use to start you off?
    the client code
    import java.net.*;
    import java.io.*;
    public class DurationClient {
         Socket socket;
         DataInputStream input;
         DataInputStream user;
         PrintStream output;
         String s;
         public DurationClient() {
                try {
                     socket = new Socket("localhost",8123);
                     input = new DataInputStream( socket.getInputStream() );
                     output = new PrintStream( socket.getOutputStream() );
                     user = new DataInputStream(System.in);
                     System.out.println("Chat Client");
                     while(true){
                   s = new String();
                     //user = new DataInputStream(System.in);
                   s = user.readLine();
                   output.println(s);
                   s = input.readLine();
                   System.out.println("Server Replied : "+s);
                   output.flush();
                   if(s.equals("Exit")){
                        output.flush();
                        output.close();
                        socket.close();
                   } catch(IOException e) {
                        e.printStackTrace();
                       System.out.println("Exception : "+e.getMessage());
                        catch(Exception e){
                          e.printStackTrace();
                          System.out.println("Exception : "+e.getMessage());
         public static void main(String[] args) {
              new DurationClient();
    }the server code
    import java.io.DataInputStream;
    import java.io.IOException;
    import java.io.PrintStream;
    import java.net.ServerSocket;
    import java.net.Socket;
    import java.util.HashMap;
    public class DurationServer {
         ServerSocket ssocket;
         Socket clientSocket;
         DataInputStream input;
         DataInputStream user;
         PrintStream output;
         String s;
         public DurationServer() {
                try {
                   System.out.println("Chat Server");
                     ssocket = new ServerSocket(8123);
                   clientSocket = ssocket.accept(); // accept 1 client.
                   input = new DataInputStream( clientSocket.getInputStream() );
                   output=new PrintStream(clientSocket.getOutputStream()) ;
                   user = new DataInputStream(System.in);
                   System.out.println("Allocated new chat server");
                   while(true) {
                        s = new String();
                        s = input.readLine();
                        System.out.println("Client Replied :"+s);
                        //user = new DataInputStream(System.in);
                        s = user.readLine();
                        output.println(s);
                        if(s.equals("Exit")){
                             output.println("Exit");
                             output.flush();
                             output.close();
                             ssocket.close();
              } catch(IOException e) {
                   e.printStackTrace();
                     System.out.println("Abnormal chat server socket condition: "+ e );
              catch(Exception e){
                   e.printStackTrace();
                  System.out.println("Exception : "+e.getMessage());
         public static void main(String[] args) {
              new DurationServer();
    }btw this isnt my code :)

  • Chat System: Layout Issues ?

    Hi there,
    A group of us are currently developing a Multiplayer Monopoly game with a Chat System.
    Within the main menu (JFrame) of the Applet, the chat System is to be drawn on by the main menu calling a JPanel with a width and height parameters. ie:
    DrawChatPanel(int width, int height) The problem is what ever the Parameters are passed in, the Jpanel and all its chat components (TextPane, buttons etc) should be dynamically resized accordingly and still fit to the layout. I have played about with numerous of the Layouts but I am having problems resizing the components.
    Would anyone have any sugestions or faced this problem before?
    Thanks!

    This should answer your questions: [url http://java.sun.com/developer/onlineTraining/GUI/AWTLayoutMgr/shortcourse.html] Effective Layour Management: Short Course
    One thing to keep in mind is burying Panels with FlowLayout within other Panels that respect Component Preferred size.

  • How can i develop gtalk type chat system

    How can i develop gtalk type chat system. How can i get deep Knowledge about AJAX. Any one can provide an example of AJAX program.

    Bagish wrote:
    How can i develop gtalk type chat system. The easiest way: don't. Find existing chat servers. Google for "Jabber".
    How can i get deep Knowledge about AJAX.Read a book about it, and do exercises.
    Any one can provide an example of AJAX program.Perhaps, but why not get the book? Or just google for "ajax tutorial" for God's sake.

  • DataBase Design For Inventory Systems

    Sir I am doing my Final Year B.sc(Comp.sci), I am having my Oracle Project to do things.
    I just wan't a Detailed DataBase Design for
    Inventory Systems
    Please Could you help me in terms of DataBase Design......

    The best way to approach a database design is to write a
    specification for the application. Document what processes the help
    desk technicians will do. In the process, identify what pieces of
    information they work with. When you have the complete
    specification written, you can then begin grouping the pieces of
    information they work with together. For example, a ticket may have
    a number, status, priority and a person to whom it is assigned. The
    person to whom the ticket is assigned will have a name, phone
    number, e-mail address and a list of technical skills.
    So in this overly-simplified example, we could have a table
    that contains ticket information, a table that has information
    about technicians and a table of skills. Then ask your self
    questions like "Can one ticket be handled by more than one
    technician?" "Can one technician handle more than one ticket?" Can
    a technician have more than one skill?" In this way, you can begin
    seeing the one-to-one, one-to-many and many-to-many relationships
    that exist.

Maybe you are looking for