Arduino udp and processing udp

hello
i am trying to send data to arduino via a gui using udp.
the following is the gui in processing and sketch for arduino.
the data sent from gui is sent to the arduino and seen on the serial port .
the data processed by arduino in result is sent back to the gui .BUT the resultant data is only displayed when something is sent through gui to arduino. Also the resultant display is in addition of the old result . (how to clear the buffer and auto recieve data on GUI)
HELP REQUIRED
ASAP

That is the way your Arduino code is programmed to work. It does not initiate a packet. It only replies to a packet sent by another device.

Are you aware that the serial port (USB) on the UNO is a SLAVE port and not a HOST port ?. Also , I am not sure you can use your TTL serial pins 0 & 1 (Rx & Tx) either because they are hardwired to the FTDI chip onboard which controls the USB-TTL conversion.
You might be able to use Software serial but based on previous post:

It does not initiate a packet. It only replies to a packet sent by another device.

that doesn't look like an option either.

raschemmel:

It does not initiate a packet. It only replies to a packet sent by another device.

that doesn't look like an option either.

This is an ethernet shield thing. It is SPI, not serial.

This pertains to the OP's script, not a limitation of the ethernet shield or library. The UdpNtpClient example sends a packet and waits for a response (NTP "client"). The OP's script is a "NTP server". I use client and server loosely because there is no connection established. I use these as which device sends the request packet and which sends a response.

Thanks for the correction.
I know nothing about Ethernet so I guess I have nothing more to say on this subject.