• Dynamic updation of a JTextArea

    From Knute Johnson@21:1/5 to abhprk3926@gmail.com on Wed Dec 14 09:14:26 2016
    On 12/14/2016 08:16, abhprk3926@gmail.com wrote:
    I created a multi user chat system using sockets in java . everything
    works perfect but a little issue. the common jtextarea where i am
    supposed to display the chats ( its a app wherein all the users write messages and the message of all the users is visible in their chat
    space. Unfortunately the jtextarea is not updating itself whenever a
    client writes a message . I tried doing like
    System.out.print(contents of the common textarea) . In the command
    prompt every single message written is displayed , which means the
    code is working as intended . its just the textarea is not updating
    itself. i searched many forums even tried doing the update thing in a different thread than EDT but still i have the same problem. Can
    anyone help me out ? Here is the code .

    public void run() { try { DataInputStream in = new DataInputStream(client.getInputStream()); //client is the socket
    object clientName = in.readUTF();
    //clientname is a string which stores the name of the clients

    s = "Joined"; SwingUtilities.invokeLater(new Runnable(){ public void
    run() { clientChat.ta.append(clientName+": "+s); //clientchat
    is the name of the Client class and ta is the common textarea object
    which is declared as a static variable } });

    while(!s.equals("terminate")) { s=in.readUTF(); SwingUtilities.invokeLater(new Runnable(){ public void run() { clientChat.ta.append(clientName+": "+s); } }); }

    }catch(Exception e){e.printStackTrace();} }

    every time a new client joins a new thread is created that acts as a
    server for the client. this is the class where the updation of the
    textarea is taking place. any help would be greatly praised.


    I don't see anything obvious in your code but I'm only seeing a piece of
    it. I suggest you try making an SSCCE and duplicating your problem or
    maybe it will help you discover an answer. Oh and formatting your code
    a little more neatly would help too. Post an SSCCE here if you can't
    get it to work.

    --

    Knute Johnson

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From abhprk3926@gmail.com@21:1/5 to All on Wed Dec 14 08:47:29 2016
    clientChat.ta is the common textarea for appending the messages.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From abhprk3926@gmail.com@21:1/5 to All on Wed Dec 14 06:16:31 2016
    I created a multi user chat system using sockets in java . everything works perfect but a little issue. the common jtextarea where i am supposed to display the chats ( its a app wherein all the users write messages and the message of all the users is
    visible in their chat space. Unfortunately the jtextarea is not updating itself whenever a client writes a message . I tried doing like System.out.print(contents of the common textarea) . In the command prompt every single message written is displayed ,
    which means the code is working as intended . its just the textarea is not updating itself. i searched many forums even tried doing the update thing in a different thread than EDT but still i have the same problem. Can anyone help me out ? Here is the
    code .

    public void run()
    {
    try
    {
    DataInputStream in = new DataInputStream(client.getInputStream()); //client is the socket object
    clientName = in.readUTF(); //clientname is a string which stores the name of the clients

    s = "Joined";
    SwingUtilities.invokeLater(new Runnable(){
    public void run()
    {
    clientChat.ta.append(clientName+": "+s); //clientchat is the name of the Client class and ta is the common textarea object which is declared as a static variable
    }
    });

    while(!s.equals("terminate"))
    {
    s=in.readUTF();
    SwingUtilities.invokeLater(new Runnable(){
    public void run()
    {
    clientChat.ta.append(clientName+": "+s);
    }
    });
    }

    }catch(Exception e){e.printStackTrace();}
    }

    every time a new client joins a new thread is created that acts as a server for the client. this is the class where the updation of the textarea is taking place. any help would be greatly praised.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From abhprk3926@gmail.com@21:1/5 to All on Wed Dec 14 08:44:47 2016
    here is the class that handles multiple chat clients....
    class chatServerThread implements Runnable
    {
    Socket client;
    Thread t;
    String clientName,s="";

    chatServerThread(Socket socket)
    {
    client=socket;
    t=new Thread(this,"newThread");
    t.start();
    }

    public void run()
    {
    try
    {
    DataInputStream in = new DataInputStream(client.getInputStream());
    s="Joined";

    clientName=in.readUTF();
    clientChat.ta.append(clientName+" : "+s);

    while(!s.equals("terminate"))
    {
    s=in.readUTF();
    clientChat.ta.append(clientName+" : "+s);
    }

    }catch(Exception e){e.printStackTrace();}
    }

    }

    here are the action event listeners in the client's class....

    send.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent ae)
    {
    new Thread(new Runnable(){
    public void run()
    {
    try
    {
    out.writeUTF(messaget.getText());

    }catch(Exception e){e.printStackTrace();}
    }
    }).start();

    }
    });

    terminate.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent ae)
    {

    new Thread(new Runnable(){
    public void run()
    {
    try
    {
    out.writeUTF("terminate");
    send.setEnabled(false);
    connect.setEnabled(true);
    namet.setEditable(true);
    ipt.setEditable(true);
    portt.setEditable(true);
    messaget.setEditable(false);
    client.close();

    }catch(Exception e){e.printStackTrace();}

    }
    }).start();
    }
    });

    connect.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent ae)
    {

    new Thread(new Runnable(){
    public void run()
    {
    if(namet.getText().length() == 0 || portt.getText().length() == 0 || ipt.getText().length() == 0)
    {
    Toolkit.getDefaultToolkit().beep();
    JOptionPane.showMessageDialog(f1,"Make Sure These Details Are Filled: \n1:Name\n2:Port Number Of Server\n3:Server's IP Address","Notice",JOptionPane.ERROR_MESSAGE);
    }
    else
    {
    try
    {
    client = new Socket(ipt.getText(),Integer.parseInt(portt.getText()));
    out = new DataOutputStream(client.getOutputStream());
    out.writeUTF(namet.getText());
    connect.setEnabled(false);
    namet.setEditable(false);
    messaget.setEditable(true);
    ipt.setEditable(false);
    portt.setEditable(false);
    send.setEnabled(true);

    }catch(Exception e){e.printStackTrace();}

    }
    }
    }).start();

    }
    });

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Knute Johnson@21:1/5 to abhprk3926@gmail.com on Wed Dec 14 15:15:45 2016
    On 12/14/2016 10:47, abhprk3926@gmail.com wrote:
    clientChat.ta is the common textarea for appending the messages.


    It's not clear to me from the pieces of your code that I have seen how
    this actually is supposed to function. But that is really irrelevant,
    what we need here is an SSCCE (see http://sscce.org).

    What I have seen of your code though does have some problems. It would
    be good if you could provide the version of Java that you are using and
    whether the text area you are writing to is a JTextArea, an AWT TextArea
    or a JavaFX TextArea, all have different requirements for threading issues.

    --

    Knute Johnson

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From abhprk3926@gmail.com@21:1/5 to All on Wed Dec 14 14:09:40 2016
    Knute i thank you for your interest in solving my issue. What my application does is i have created a class in which a loop continously listens for connection requests. Another one that i posted in my previous comment is the chatServerThread class that
    allocates a new thread to each request. And then the last class is the client chat window. What i have done is that i have created a common textarea in which all the users write their messages. And i have included that JTextarea ( JSwing ) in all of the
    client chat window. But that textarea is not updating ehen i write a message from any one of the clients window. If you order me i would post the entire code here. Please help me out .

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Knute Johnson@21:1/5 to abhprk3926@gmail.com on Wed Dec 14 16:23:31 2016
    On 12/14/2016 16:09, abhprk3926@gmail.com wrote:
    Knute i thank you for your interest in solving my issue. What my
    application does is i have created a class in which a loop
    continously listens for connection requests. Another one that i
    posted in my previous comment is the chatServerThread class that
    allocates a new thread to each request. And then the last class is
    the client chat window. What i have done is that i have created a
    common textarea in which all the users write their messages. And i
    have included that JTextarea ( JSwing ) in all of the client chat
    window. But that textarea is not updating ehen i write a message from
    any one of the clients window. If you order me i would post the
    entire code here. Please help me out .


    So how many times have you added this one JTextArea to a container?

    --

    Knute Johnson

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Knute Johnson@21:1/5 to abhprk3926@gmail.com on Wed Dec 14 16:24:01 2016
    On 12/14/2016 16:09, abhprk3926@gmail.com wrote:
    Knute i thank you for your interest in solving my issue. What my
    application does is i have created a class in which a loop
    continously listens for connection requests. Another one that i
    posted in my previous comment is the chatServerThread class that
    allocates a new thread to each request. And then the last class is
    the client chat window. What i have done is that i have created a
    common textarea in which all the users write their messages. And i
    have included that JTextarea ( JSwing ) in all of the client chat
    window. But that textarea is not updating ehen i write a message from
    any one of the clients window. If you order me i would post the
    entire code here. Please help me out .


    So how many times have you added this one JTextArea to a container?

    --

    Knute Johnson

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Knute Johnson@21:1/5 to Knute Johnson on Wed Dec 14 15:46:32 2016
    On 12/14/2016 15:15, Knute Johnson wrote:
    On 12/14/2016 10:47, abhprk3926@gmail.com wrote:
    clientChat.ta is the common textarea for appending the messages.


    It's not clear to me from the pieces of your code that I have seen how
    this actually is supposed to function. But that is really irrelevant,
    what we need here is an SSCCE (see http://sscce.org).

    What I have seen of your code though does have some problems. It would
    be good if you could provide the version of Java that you are using and whether the text area you are writing to is a JTextArea, an AWT TextArea
    or a JavaFX TextArea, all have different requirements for threading issues.


    Well you did say JTextArea in the subject. So all of the calls in that
    last bit you sent where things are enabled and set editable, needs to be
    done on the EDT.

    If you are using Java 8 you can simplify that code considerably.
    Instead of:

    something.addActionListener(new ActionListener() {
    public void ActionPerformed(ActionEvent ae) {
    new Thread(new Runnable() {
    public void run() {

    you can use:

    something.addActionListener(ae -> {
    new Thread(() -> {

    To run code on the EDT:

    EventQueue.invokeLater(() -> {
    // this code is run on EDT
    });

    --

    Knute Johnson

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From abhprk3926@gmail.com@21:1/5 to All on Thu Dec 15 00:18:49 2016
    just one time when i have created the chat class. here lemme show. here is the full code .

    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.Toolkit;

    class mainServer
    {
    public static void main(String args[])
    {
    if(args.length!=1)
    {
    System.out.println("Port Number Required");
    System.exit(-1);
    }

    try(ServerSocket server = new ServerSocket(Integer.parseInt(args[0])))
    {
    while(true)
    new chatServerThread(server.accept());

    }catch(Exception e){e.printStackTrace();}
    }
    }

    class chatServerThread implements Runnable
    {
    Socket client;
    Thread t;
    String clientName,s="";

    chatServerThread(Socket socket)
    {
    client=socket;
    t=new Thread(this,"newThread");
    t.start();
    }

    public void run()
    {
    try
    {
    DataInputStream in = new DataInputStream(client.getInputStream());
    s="Joined";

    clientName=in.readUTF();
    clientChat.ta.append(clientName+" : "+s);

    new Thread(new Runnable(){
    public void run()
    {
    while(!s.equals("terminate"))
    {
    try
    {
    s=in.readUTF();
    clientChat.ta.append(clientName+" : "+s);

    }catch(Exception e){e.printStackTrace();}

    }
    }
    }).start();


    }catch(Exception e){e.printStackTrace();}
    }

    }

    class clientChat
    {
    public JFrame f1 = new JFrame();
    public JLabel name = new JLabel("Enter Name : ");
    public JTextField namet = new JTextField(20);
    public JLabel port = new JLabel("Enter Port Number : ");
    public JTextField portt = new JTextField(20);
    public JLabel ip = new JLabel("Enter Server's IP : ");
    public JTextField ipt = new JTextField(20);
    public JButton connect = new JButton("Connect To Server");
    public JLabel message = new JLabel("Write Message : ");
    public JTextField messaget = new JTextField(20);
    public static JTextArea ta = new JTextArea();
    public static JScrollPane jsp = new JScrollPane(ta);
    public JButton send = new JButton("Send Message");
    public JButton terminate = new JButton("Close Session");
    Socket client=null;
    DataOutputStream out=null;

    clientChat()
    {
    f1.setSize(525,400);
    send.setEnabled(false);
    ta.setEditable(false);
    f1.setResizable(false);
    messaget.setEditable(false);
    f1.setTitle("Chat Window");
    f1.setLocationRelativeTo(null);
    f1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setLayout();
    f1.setVisible(true);

    send.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent ae)
    {

    try
    {
    out.writeUTF(messaget.getText());

    }catch(Exception e){e.printStackTrace();}

    }
    });

    terminate.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent ae)
    {

    try
    {
    out.writeUTF("terminate");
    send.setEnabled(false);
    connect.setEnabled(true);
    namet.setEditable(true);
    ipt.setEditable(true);
    portt.setEditable(true);
    messaget.setEditable(false);
    client.close();

    }catch(Exception e){e.printStackTrace();}

    }
    });

    connect.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent ae)
    {


    if(namet.getText().length() == 0 || portt.getText().length() == 0 || ipt.getText().length() == 0)
    {
    Toolkit.getDefaultToolkit().beep();
    JOptionPane.showMessageDialog(f1,"Make Sure These Details Are Filled: \n1:Name\n2:Port Number Of Server\n3:Server's IP Address","Notice",JOptionPane.ERROR_MESSAGE);
    }
    else
    {
    try
    {
    client = new Socket(ipt.getText(),Integer.parseInt(portt.getText()));
    out = new DataOutputStream(client.getOutputStream());
    out.writeUTF(namet.getText());
    connect.setEnabled(false);
    namet.setEditable(false);
    messaget.setEditable(true);
    ipt.setEditable(false);
    portt.setEditable(false);
    send.setEnabled(true);

    }catch(Exception e){e.printStackTrace();}

    }

    }
    });
    }

    public void setLayout()
    {
    GroupLayout gl = new GroupLayout(f1.getContentPane());
    f1.getContentPane().setLayout(gl);
    gl.setAutoCreateGaps(true);
    gl.setAutoCreateContainerGaps(true);

    gl.setHorizontalGroup(
    gl.createParallelGroup()
    .addGroup(gl.createSequentialGroup()
    .addComponent(name)
    .addComponent(namet)
    .addComponent(connect))
    .addGroup(gl.createSequentialGroup()
    .addComponent(port)
    .addComponent(portt))
    .addGroup(gl.createSequentialGroup()
    .addComponent(ip)
    .addComponent(ipt))
    .addGroup(gl.createSequentialGroup()
    .addComponent(message)
    .addComponent(messaget)
    .addComponent(send))
    .addComponent(jsp)
    .addComponent(terminate)
    );

    gl.setVerticalGroup(
    gl.createSequentialGroup()
    .addGroup(gl.createParallelGroup(GroupLayout.Alignment.BASELINE)
    .addComponent(name)
    .addComponent(namet)
    .addComponent(connect))
    .addGroup(gl.createParallelGroup(GroupLayout.Alignment.BASELINE)
    .addComponent(port)
    .addComponent(portt))
    .addGroup(gl.createParallelGroup(GroupLayout.Alignment.BASELINE)
    .addComponent(ip)
    .addComponent(ipt))
    .addGroup(gl.createParallelGroup(GroupLayout.Alignment.BASELINE)
    .addComponent(message)
    .addComponent(messaget)
    .addComponent(send))
    .addComponent(jsp)
    .addComponent(terminate)
    );

    gl.linkSize(SwingConstants.HORIZONTAL,name,port,ip,message);
    gl.linkSize(SwingConstants.HORIZONTAL,namet,portt,ipt,messaget);
    gl.linkSize(SwingConstants.HORIZONTAL,connect,send);
    }

    public static void main(String args[])
    {
    SwingUtilities.invokeLater(new Runnable(){
    public void run()
    {
    new clientChat();
    }
    });
    }

    }

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Knute Johnson@21:1/5 to abhprk3926@gmail.com on Thu Dec 15 14:58:21 2016
    On 12/15/2016 02:18, abhprk3926@gmail.com wrote:
    just one time when i have created the chat class. here lemme show. here is the full code .

    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.Toolkit;

    class mainServer
    {
    public static void main(String args[])
    {
    if(args.length!=1)
    {
    System.out.println("Port Number Required");
    System.exit(-1);
    }

    try(ServerSocket server = new ServerSocket(Integer.parseInt(args[0])))
    {
    while(true)
    new chatServerThread(server.accept());

    }catch(Exception e){e.printStackTrace();}
    }
    }

    class chatServerThread implements Runnable
    {
    Socket client;
    Thread t;
    String clientName,s="";

    chatServerThread(Socket socket)
    {
    client=socket;
    t=new Thread(this,"newThread");
    t.start();
    }

    public void run()
    {
    try
    {
    DataInputStream in = new DataInputStream(client.getInputStream());
    s="Joined";

    clientName=in.readUTF();
    clientChat.ta.append(clientName+" : "+s);

    new Thread(new Runnable(){
    public void run()
    {
    while(!s.equals("terminate"))
    {
    try
    {
    s=in.readUTF();
    clientChat.ta.append(clientName+" : "+s);

    }catch(Exception e){e.printStackTrace();}

    }
    }
    }).start();


    }catch(Exception e){e.printStackTrace();}
    }

    }

    class clientChat
    {
    public JFrame f1 = new JFrame();
    public JLabel name = new JLabel("Enter Name : ");
    public JTextField namet = new JTextField(20);
    public JLabel port = new JLabel("Enter Port Number : ");
    public JTextField portt = new JTextField(20);
    public JLabel ip = new JLabel("Enter Server's IP : ");
    public JTextField ipt = new JTextField(20);
    public JButton connect = new JButton("Connect To Server");
    public JLabel message = new JLabel("Write Message : ");
    public JTextField messaget = new JTextField(20);
    public static JTextArea ta = new JTextArea();
    public static JScrollPane jsp = new JScrollPane(ta);
    public JButton send = new JButton("Send Message");
    public JButton terminate = new JButton("Close Session");
    Socket client=null;
    DataOutputStream out=null;

    clientChat()
    {
    f1.setSize(525,400);
    send.setEnabled(false);
    ta.setEditable(false);
    f1.setResizable(false);
    messaget.setEditable(false);
    f1.setTitle("Chat Window");
    f1.setLocationRelativeTo(null);
    f1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setLayout();
    f1.setVisible(true);

    send.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent ae)
    {

    try
    {
    out.writeUTF(messaget.getText());

    }catch(Exception e){e.printStackTrace();}

    }
    });

    terminate.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent ae)
    {

    try
    {
    out.writeUTF("terminate");
    send.setEnabled(false);
    connect.setEnabled(true);
    namet.setEditable(true);
    ipt.setEditable(true);
    portt.setEditable(true);
    messaget.setEditable(false);
    client.close();

    }catch(Exception e){e.printStackTrace();}

    }
    });

    connect.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent ae)
    {


    if(namet.getText().length() == 0 || portt.getText().length() == 0 || ipt.getText().length() == 0)
    {
    Toolkit.getDefaultToolkit().beep();
    JOptionPane.showMessageDialog(f1,"Make Sure These Details Are Filled: \n1:Name\n2:Port Number Of Server\n3:Server's IP Address","Notice",JOptionPane.ERROR_MESSAGE);
    }
    else
    {
    try
    {
    client = new Socket(ipt.getText(),Integer.parseInt(portt.getText()));
    out = new DataOutputStream(client.getOutputStream());
    out.writeUTF(namet.getText());
    connect.setEnabled(false);
    namet.setEditable(false);
    messaget.setEditable(true);
    ipt.setEditable(false);
    portt.setEditable(false);
    send.setEnabled(true);

    }catch(Exception e){e.printStackTrace();}

    }

    }
    });
    }

    public void setLayout()
    {
    GroupLayout gl = new GroupLayout(f1.getContentPane());
    f1.getContentPane().setLayout(gl);
    gl.setAutoCreateGaps(true);
    gl.setAutoCreateContainerGaps(true);

    gl.setHorizontalGroup(
    gl.createParallelGroup()
    .addGroup(gl.createSequentialGroup()
    .addComponent(name)
    .addComponent(namet)
    .addComponent(connect))
    .addGroup(gl.createSequentialGroup()
    .addComponent(port)
    .addComponent(portt))
    .addGroup(gl.createSequentialGroup()
    .addComponent(ip)
    .addComponent(ipt))
    .addGroup(gl.createSequentialGroup()
    .addComponent(message)
    .addComponent(messaget)
    .addComponent(send))
    .addComponent(jsp)
    .addComponent(terminate)
    );

    gl.setVerticalGroup(
    gl.createSequentialGroup()
    .addGroup(gl.createParallelGroup(GroupLayout.Alignment.BASELINE)
    .addComponent(name)
    .addComponent(namet)
    .addComponent(connect))
    .addGroup(gl.createParallelGroup(GroupLayout.Alignment.BASELINE)
    .addComponent(port)
    .addComponent(portt))
    .addGroup(gl.createParallelGroup(GroupLayout.Alignment.BASELINE)
    .addComponent(ip)
    .addComponent(ipt))
    .addGroup(gl.createParallelGroup(GroupLayout.Alignment.BASELINE)
    .addComponent(message)
    .addComponent(messaget)
    .addComponent(send))
    .addComponent(jsp)
    .addComponent(terminate)
    );

    gl.linkSize(SwingConstants.HORIZONTAL,name,port,ip,message);
    gl.linkSize(SwingConstants.HORIZONTAL,namet,portt,ipt,messaget);
    gl.linkSize(SwingConstants.HORIZONTAL,connect,send);
    }

    public static void main(String args[])
    {
    SwingUtilities.invokeLater(new Runnable(){
    public void run()
    {
    new clientChat();
    }
    });
    }

    }

    I think I see what your problem is (or at least one of them). In
    mainServer you reference clientChat.ta which is a static variable. When mainServer then creates a clientChat object it is a different clientChat
    object than when the program clientChat creates that object. You say
    "how can that be, it's static and there is only one static object?"
    Well there is one in the virtual machine that is running mainServer and
    there is one in the virtual machine that is running clientChat they
    aren't the same object.

    I think this would have become obvious to you had you done as I
    suggested and created an SSCCE. You would have seen that adding text to
    a JTextArea running in one virtual machine would not affect another
    JTextArea running in another virtual machine even if they are static.

    In a classic "Chat" program you have clients connecting and
    disconnecting from the server and you have messages coming from a client
    to the server and back out to all the other clients. Your server needs
    to be a little smarter and keep track of everybody that is connected so
    when a message comes in the server can send it out to everybody that is connected.


    --

    Knute Johnson

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From abhprk3926@gmail.com@21:1/5 to All on Fri Dec 16 02:23:02 2016
    yes knute i think you are right. my approach is wrong. i need to make changes in my program. thanks very much for your solutions knute.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)