<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Advanced programs | Student Projects</title>
	<atom:link href="https://studentprojects.in/category/software-development/java/java-programs/advanced/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Wed, 02 Feb 2011 15:05:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>java program for Client-Server Program using TCP/IP</title>
		<link>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-for-client-server-program-using-tcpip-2/</link>
					<comments>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-for-client-server-program-using-tcpip-2/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Wed, 02 Feb 2011 14:40:56 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1165</guid>

					<description><![CDATA[<p>Program : Client-Server Program using TCP/IP By : Kapil Lohia import java.net.*; import java.io.*; class tcpip_server { public static void main(String args[]) throws IOException { ServerSocket n1=null; try { n1=new ServerSocket(98); } catch(IOException e) { System.err.println("Port 98 could not be found"); System.exit(1); } Socket c=null; try { c=n1.accept(); System.out.println("Connection from "+c); } catch(IOException e) {</p>
<p>The post <a href="https://studentprojects.in/software-development/java/java-programs/advanced/java-program-for-client-server-program-using-tcpip-2/">java program for Client-Server Program using TCP/IP</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Program : Client-Server Program using TCP/IP By : Kapil Lohia</p>
<pre lang="java">import java.net.*;
import java.io.*;

class tcpip_server
{
	public static void main(String args[]) throws IOException
	{
		ServerSocket n1=null;
		try
		{
			n1=new ServerSocket(98);
		}
		catch(IOException e)
		{
			System.err.println("Port 98 could not be found");
			System.exit(1);
		}
		Socket c=null;
		try
		{
			c=n1.accept();
			System.out.println("Connection from "+c);
		}
		catch(IOException e)
		{
			System.out.println("Accept failed");
			System.exit(1);
		}
		PrintWriter out=new PrintWriter(c.getOutputStream(),true);
		BufferedReader in=new BufferedReader(new InputStreamReader(c.getInputStream()));
		String n;
		BufferedReader sin=new BufferedReader(new InputStreamReader(System.in));
		System.out.println("Ready to type now");
		while((n=sin.readLine())!=null)
		{
			out.println(n);
		}
		out.close();
		c.close();
		n1.close();
	}
}
</pre><p>The post <a href="https://studentprojects.in/software-development/java/java-programs/advanced/java-program-for-client-server-program-using-tcpip-2/">java program for Client-Server Program using TCP/IP</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-for-client-server-program-using-tcpip-2/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Java program to display the IP Address of a particular Host</title>
		<link>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-to-display-the-ip-address-of-a-particular-host/</link>
					<comments>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-to-display-the-ip-address-of-a-particular-host/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Fri, 30 Apr 2010 05:52:55 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[host ip address]]></category>
		<category><![CDATA[display ip address]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1170</guid>

					<description><![CDATA[<p>Program : To display the IP Address of a particular Host By : Kapil Lohia import java.net.*; import java.io.*; public class ip_host { public static void main(String args[]) throws Exception { System.out.println("Enter the host name :"); String n=new DataInputStream(System.in).readLine(); InetAddress ipadd =InetAddress.getByName(n); System.out.println("IP address :"+ipadd); } }</p>
<p>The post <a href="https://studentprojects.in/software-development/java/java-programs/advanced/java-program-to-display-the-ip-address-of-a-particular-host/">Java program to display the IP Address of a particular Host</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Program : To display the IP Address of a particular Host<br />
By : Kapil Lohia </p>
<pre lang="java">
import java.net.*;
import java.io.*;

public class ip_host
{
	public static void main(String args[]) throws Exception
	{
		System.out.println("Enter the host name :");
		String n=new DataInputStream(System.in).readLine();

		InetAddress ipadd =InetAddress.getByName(n);

		System.out.println("IP address :"+ipadd);
	}
}
</pre><p>The post <a href="https://studentprojects.in/software-development/java/java-programs/advanced/java-program-to-display-the-ip-address-of-a-particular-host/">Java program to display the IP Address of a particular Host</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-to-display-the-ip-address-of-a-particular-host/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Java program to display Local machines IP Address</title>
		<link>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-to-display-local-machines-ip-address/</link>
					<comments>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-to-display-local-machines-ip-address/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Fri, 30 Apr 2010 05:51:24 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Local machines IP Address]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1168</guid>

					<description><![CDATA[<p>Program : To display Local machines IP Address By : Kapil Lohia import java.net.*; import java.io.*; public class ip_localmachine { public static void main(String args[]) throws Exception { InetAddress ipadd =InetAddress.getLocalHost(); System.out.println("Host and Address :"+ipadd); System.out.println("Host name :"+ipadd.getHostName()); String n=ipadd.toString(); System.out.println("IP address :"+n.substring(n.indexOf("/")+1)); } }</p>
<p>The post <a href="https://studentprojects.in/software-development/java/java-programs/advanced/java-program-to-display-local-machines-ip-address/">Java program to display Local machines IP Address</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Program : To display Local machines IP Address<br />
By : Kapil Lohia </p>
<pre lang="java">
import java.net.*;
import java.io.*;

public class ip_localmachine
{
	public static void main(String args[]) throws Exception
	{
		InetAddress ipadd =InetAddress.getLocalHost();
		System.out.println("Host and Address :"+ipadd);
		System.out.println("Host name :"+ipadd.getHostName());

		String n=ipadd.toString();
		System.out.println("IP address :"+n.substring(n.indexOf("/")+1));
	}
}
</pre><p>The post <a href="https://studentprojects.in/software-development/java/java-programs/advanced/java-program-to-display-local-machines-ip-address/">Java program to display Local machines IP Address</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-to-display-local-machines-ip-address/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>java program for Client-Server Program using TCP/IP</title>
		<link>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-for-client-server-program-using-tcpip/</link>
					<comments>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-for-client-server-program-using-tcpip/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Fri, 30 Apr 2010 05:47:45 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[client server]]></category>
		<category><![CDATA[tcep ip]]></category>
		<guid isPermaLink="false">http://studentprojects.in/source-codes/software-programs/java/advanced-programs/java-program-for-client-server-program-using-tcpip/</guid>

					<description><![CDATA[<p>Program : Client-Server Program using TCP/IP By : Kapil Lohia Program 1: import java.net.*; import java.io.*; class tcpip_server { public static void main(String args[]) throws IOException { ServerSocket n1=null; try { n1=new ServerSocket(98); } catch(IOException e) { System.err.println("Port 98 could not be found"); System.exit(1); } Socket c=null; try { c=n1.accept(); System.out.println("Connection from "+c); } catch(IOException</p>
<p>The post <a href="https://studentprojects.in/software-development/java/java-programs/advanced/java-program-for-client-server-program-using-tcpip/">java program for Client-Server Program using TCP/IP</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Program : Client-Server Program using TCP/IP<br />
By : Kapil Lohia </p>
<p><strong>Program 1:</strong></p>
<pre lang="java">

import java.net.*;
import java.io.*;

class tcpip_server
{
	public static void main(String args[]) throws IOException
	{
		ServerSocket n1=null;
		try
		{
			n1=new ServerSocket(98);
		}
		catch(IOException e)
		{
			System.err.println("Port 98 could not be found");
			System.exit(1);
		}
		Socket c=null;
		try
		{
			c=n1.accept();
			System.out.println("Connection from "+c);
		}
		catch(IOException e)
		{
			System.out.println("Accept failed");
			System.exit(1);
		}
		PrintWriter out=new PrintWriter(c.getOutputStream(),true);
		BufferedReader in=new BufferedReader(new InputStreamReader(c.getInputStream()));
		String n;
		BufferedReader sin=new BufferedReader(new InputStreamReader(System.in));
		System.out.println("Ready to type now");
		while((n=sin.readLine())!=null)
		{
			out.println(n);
		}
		out.close();
		c.close();
		n1.close();
	}
}
</pre>
<p><strong>Program 2</strong></p>
<pre lang="java">

import java.net.*;
import java.io.*;

class tcpip_client
{
	public static void main(String args[]) throws IOException
	{
		Socket s=null;
		BufferedReader b=null;

		try
		{
			s=new Socket(InetAddress.getLocalHost(),98);
			b=new BufferedReader(new InputStreamReader(s.getInputStream()));
		}

		catch(UnknownHostException u)
		{
			System.err.println("I don't know host");
			System.exit(0);
		}
		String inp;
		while((inp=b.readLine())!=null)
		{
			System.out.println(inp);
		}
		b.close();
		s.close();
	}
}
</pre><p>The post <a href="https://studentprojects.in/software-development/java/java-programs/advanced/java-program-for-client-server-program-using-tcpip/">java program for Client-Server Program using TCP/IP</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-for-client-server-program-using-tcpip/feed/</wfw:commentRss>
			<slash:comments>41</slash:comments>
		
		
			</item>
		<item>
		<title>DatagramSocket and DatagramPacket (Client-Server Program using UDP/IP)</title>
		<link>https://studentprojects.in/software-development/java/java-programs/advanced/datagramsocket-and-datagrampacket-client-server-program-using-udpip/</link>
					<comments>https://studentprojects.in/software-development/java/java-programs/advanced/datagramsocket-and-datagrampacket-client-server-program-using-udpip/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Fri, 30 Apr 2010 05:44:20 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[DatagramSocket]]></category>
		<category><![CDATA[DatagramPacket]]></category>
		<category><![CDATA[client server pragramming]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1162</guid>

					<description><![CDATA[<p>Program : DatagramSocket and DatagramPacket (Client-Server Program using UDP/IP) By : Kapil Lohia Program 1 : import java.net.*; class udpip_server { public static DatagramSocket ds; public static byte buffer[]=new byte[1024]; public static void Myserver() throws Exception { int pos=0; while(true) { int c=System.in.read(); switch(c) { case -1: System.out.println("Server quits"); return; case '\r':break; case '\n':ds.send(new DatagramPacket(buffer,pos,InetAddress.getLocalHost(),777));</p>
<p>The post <a href="https://studentprojects.in/software-development/java/java-programs/advanced/datagramsocket-and-datagrampacket-client-server-program-using-udpip/">DatagramSocket and DatagramPacket (Client-Server Program using UDP/IP)</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Program : DatagramSocket and DatagramPacket (Client-Server Program using UDP/IP)<br />
By : Kapil Lohia </p>
<p><strong>Program 1 :</strong></p>
<pre lang="java">

import java.net.*;

class udpip_server
{
	public static DatagramSocket ds;
	public static byte buffer[]=new byte[1024];

	public static void Myserver() throws Exception
	{
		int pos=0;
		while(true)
		{
			int c=System.in.read();
			switch(c)
			{
				case -1: System.out.println("Server quits");
				return;
				case '\r':break;
				case '\n':ds.send(new DatagramPacket(buffer,pos,InetAddress.getLocalHost(),777));
				           pos=0;
				break;
				default:
				buffer[pos++]=(byte) c;
			}
		}
	}

	public static void main(String args[]) throws Exception
	{
		System.out.println("Server ready..\n Please type here");
		ds=new DatagramSocket(888);
		Myserver();
	}
}
</pre>
<p><strong>Program 2:</strong></p>
<pre lang="java">

import java.net.*;

class udpip_client
{
	public static DatagramSocket ds;
	public static byte buffer[]=new byte[1024];

	public static void Myclient() throws Exception
	{
		while(true)
		{
			DatagramPacket p=new DatagramPacket(buffer,buffer.length);
			ds.receive(p);
			System.out.println(new String(p.getData(),0,p.getLength()));
		}
	}

	public static void main(String args[]) throws Exception
	{
		System.out.println("Client - Press CTRL+C to quit");
		ds=new DatagramSocket(777);
		Myclient();
	}
}
</pre><p>The post <a href="https://studentprojects.in/software-development/java/java-programs/advanced/datagramsocket-and-datagrampacket-client-server-program-using-udpip/">DatagramSocket and DatagramPacket (Client-Server Program using UDP/IP)</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/java/java-programs/advanced/datagramsocket-and-datagrampacket-client-server-program-using-udpip/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Java program for Uniform Resource Locator (URL)</title>
		<link>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-for-uniform-resource-locator-url/</link>
					<comments>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-for-uniform-resource-locator-url/#respond</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Fri, 30 Apr 2010 05:27:24 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[Uniform Resource Locator (URL)]]></category>
		<category><![CDATA[URL]]></category>
		<category><![CDATA[Java]]></category>
		<guid isPermaLink="false">http://studentprojects.in/source-codes/software-programs/java/advanced-programs/java-program-for-uniform-resource-locator-url/</guid>

					<description><![CDATA[<p>Program : Uniform Resource Locator (URL) By : Kapil Lohia import java.net.*; import java.io.*; class url { public static void main(String args[]) throws Exception { URL n1 = new URL("http://java.sun.com:80/docs/index#down"); System.out.println("Protocol:"+n1.getProtocol()); System.out.println("Host :"+n1.getHost()); System.out.println("File Name :"+n1.getFile()); System.out.println("Port :"+n1.getPort()); System.out.println("Reference :"+n1.getRef()); } }</p>
<p>The post <a href="https://studentprojects.in/software-development/java/java-programs/advanced/java-program-for-uniform-resource-locator-url/">Java program for Uniform Resource Locator (URL)</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Program : Uniform Resource Locator (URL)<br />
By : Kapil Lohia </p>
<pre lang="java">
import java.net.*;
import java.io.*;

class url
{
	public static void main(String args[]) throws Exception
	{
		URL n1 = new URL("http://java.sun.com:80/docs/index#down");
		System.out.println("Protocol:"+n1.getProtocol());
		System.out.println("Host :"+n1.getHost());
		System.out.println("File Name :"+n1.getFile());
		System.out.println("Port :"+n1.getPort());
		System.out.println("Reference :"+n1.getRef());
	}
}
</pre><p>The post <a href="https://studentprojects.in/software-development/java/java-programs/advanced/java-program-for-uniform-resource-locator-url/">Java program for Uniform Resource Locator (URL)</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-for-uniform-resource-locator-url/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Java program to display a clock</title>
		<link>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-to-display-a-clock/</link>
					<comments>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-to-display-a-clock/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Thu, 03 Dec 2009 11:45:54 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[java clock]]></category>
		<category><![CDATA[clock program]]></category>
		<category><![CDATA[download programs]]></category>
		<category><![CDATA[Java codes]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=974</guid>

					<description><![CDATA[<p>background_ = new GSegment();<br />
      GStyle backgroundStyle = new GStyle();<br />
      backgroundStyle.setBackgroundColor (new Color (122, 136, 161));<br />
      backgroundStyle.setForegroundColor (new Color (0, 0, 0));<br />
      background_.setStyle (backgroundStyle);<br />
      addSegment (background_);</p>
<p>The post <a href="https://studentprojects.in/software-development/java/java-programs/advanced/java-program-to-display-a-clock/">Java program to display a clock</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Program by Avinash Kumar Pandey</p>
<pre lang="java">
import java.util.Calendar;
import java.util.Timer;
import java.util.TimerTask;
import java.awt.*;

import javax.swing.*;

import no.geosoft.cc.geometry.Geometry;
import no.geosoft.cc.geometry.Matrix4x4;
import no.geosoft.cc.graphics.*;

/**
 * Graphics program. Demonstrates:
 *
 * <ul>
 * <li> Advaced geometry generation
 * <li> Dynamic update
 * <li> Threading
 * </ul>
 * 
*/   
public class Demo23 extends JFrame
{
  public Demo23()
  {
    super ("G Graphics Library - Demo 23");    
    setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
    
    // Create the graphic canvas
    GWindow window = new GWindow (new Color (210, 235, 255));
    getContentPane().add (window.getCanvas());
    
    // Create scene with default viewport and world extent settings
    GScene scene = new GScene (window);
    double w0[] = {  0.0,   0.0, 0.0};
    double w1[] = {1000.0,   0.0, 0.0};
    double w2[] = {  0.0, 1000.0, 0.0};
    scene.setWorldExtent (w0, w1, w2);

    // Create clock
    GClock clock1 = new GClock (500, 500, 350);
    scene.add (clock1);

    // GClock clock2 = new GClock (40, 80, 15);
    // scene.add (clock2);

    pack();
    setSize (new Dimension (500, 500));
    setVisible (true);

    window.startInteraction (new ZoomInteraction (scene));

    Timer timer = new Timer (true);
    timer.schedule (new Ticker (clock1), 0, 1000);
  }
 
  /**
   * Defines the geometry and presentation for the sample
   * graphic object.
   */   
  private class GClock extends GObject
  {
    private double      x0_, y0_;
    private double      radius_;
    private GSegment    background_;
    private GSegment    disc_;
    private GSegment[]  ticks_;
    private GSegment[]  labels_;
    private GSegment    hourHandle_;
    private GSegment    minuteHandle_;
    private GSegment    secondHandle_;
    private GSegment    brand_;
    private double[]    hourHandleGeometry_;
    private double[]    minuteHandleGeometry_;
    private double[]    secondHandleGeometry_;
            
    public GClock (double x0, double y0, double radius)
    {
      x0_     = x0;
      y0_     = y0;
      radius_ = radius;

      background_ = new GSegment();
      GStyle backgroundStyle = new GStyle();
      backgroundStyle.setBackgroundColor (new Color (122, 136, 161));
      backgroundStyle.setForegroundColor (new Color (0, 0, 0));
      background_.setStyle (backgroundStyle);
      addSegment (background_);
      
      disc_ = new GSegment();
      GStyle discStyle = new GStyle();
      discStyle.setBackgroundColor (new Color (255, 255, 255));
      discStyle.setForegroundColor (new Color (255, 255, 255));
      disc_.setStyle (discStyle);
      addSegment (disc_);

      ticks_ = new GSegment[60];
      GStyle minuteStyle = new GStyle();
      minuteStyle.setForegroundColor (new Color (0, 0, 0));
      minuteStyle.setLineWidth (1);

      GStyle tickStyle = (GStyle) minuteStyle.clone();
      tickStyle.setLineWidth (3);
      
      for (int i = 0; i < 60; i++) {
        ticks_[i] = new GSegment();
        ticks_[i].setStyle (i % 5 == 0 ? tickStyle : minuteStyle);
        addSegment (ticks_[i]);
      }

      labels_ = new GSegment[12];
      GStyle labelStyle = new GStyle();
      labelStyle.setForegroundColor (new Color (0, 0, 0));
      labelStyle.setLineStyle (GStyle.LINESTYLE_INVISIBLE);
      labelStyle.setFont (new Font ("Dialog", Font.BOLD, 24));
      for (int i = 0; i < 12; i++) {
        labels_[i] = new GSegment();
        labels_[i].setStyle (labelStyle);
        int hour = (14 - i) % 12 + 1;
        labels_[i].setText (new GText (Integer.toString (hour)));
        addSegment (labels_[i]);
      }

      brand_ = new GSegment();
      GStyle brandStyle = new GStyle();
      brandStyle.setForegroundColor (new Color (0, 0, 0));
      brandStyle.setFont (new Font ("Times", Font.PLAIN, 12));
      brandStyle.setLineStyle (GStyle.LINESTYLE_INVISIBLE);
      brand_.setStyle (brandStyle);
      brand_.setText (new GText ("GeoSoft", GPosition.MIDDLE));
      addSegment (brand_);

      GStyle handleStyle = new GStyle();
      handleStyle.setForegroundColor (new Color (0.0f, 0.0f, 0.0f, 0.5f));
      handleStyle.setBackgroundColor (new Color (0.0f, 0.0f, 0.0f, 0.3f));
      handleStyle.setLineWidth (1);      

      GStyle secondHandleStyle = new GStyle();
      secondHandleStyle.setForegroundColor (new Color (255, 0, 0));
      secondHandleStyle.setBackgroundColor (new Color (255, 0, 0));
      secondHandleStyle.setLineWidth (1);      
      
      hourHandle_ = new GSegment();
      hourHandle_.setStyle (handleStyle);
      addSegment (hourHandle_);

      hourHandleGeometry_ = new double[]
                            {- 0.10*radius_, - 0.04*radius_,
                             - 0.10*radius_, + 0.04*radius_,
                             + 0.60*radius_, + 0.04*radius_,
                             + 0.65*radius_, 0.0,
                             + 0.60*radius_, - 0.04*radius_,
                             - 0.10*radius_, - 0.04*radius_};
      
      minuteHandle_ = new GSegment();
      minuteHandle_.setStyle (handleStyle);      
      addSegment (minuteHandle_);

      minuteHandleGeometry_ = new double[]
                            {- 0.10*radius_, - 0.04*radius_,
                             - 0.10*radius_, + 0.04*radius_,
                             + 0.90*radius_, + 0.04*radius_,
                             + 0.95*radius_, 0.0,
                             + 0.90*radius_, - 0.04*radius_,
                             - 0.10*radius_, - 0.04*radius_};

      secondHandle_ = new GSegment();
      secondHandle_.setStyle (secondHandleStyle);
      addSegment (secondHandle_);

      secondHandleGeometry_ = new double[]
                            {- 0.10*radius_, - 0.02*radius_,
                             + 0.85*radius_, 0.0,
                             - 0.10*radius_, + 0.02*radius_,
                             - 0.10*radius_, - 0.02*radius_};
    }

    private void update()
    {
      Calendar time = Calendar.getInstance();

      int hour   = time.get (Calendar.HOUR_OF_DAY);
      int minute = time.get (Calendar.MINUTE);
      int second = time.get (Calendar.SECOND);
      int secondOfDay = second + minute*60 + hour*60*60;

      double hourAngle = Math.PI / 2.0 -
                         (double) secondOfDay / (24.0 * 60.0 * 60.0) *
                         Math.PI * 4.0;

      secondOfDay -= hour*60*60;

      double minuteAngle = Math.PI / 2.0 -
                           (double) secondOfDay / (60.0 * 60.0) *
                           Math.PI * 2.0;

      secondOfDay -= minute*60;

      double secondAngle = Math.PI / 2.0 -
                           (double) secondOfDay / 60.0 *
                           Math.PI * 2.0;
      
      double[] geometry = new double[hourHandleGeometry_.length];
      System.arraycopy (hourHandleGeometry_, 0, geometry, 0,
                        hourHandleGeometry_.length);
      Matrix4x4 m = new Matrix4x4();
      m.rotateZ (hourAngle);
      m.translate (x0_, y0_, 0.0);
      m.transformXyPoints (geometry);
      hourHandle_.setGeometryXy (geometry);

      geometry = new double[minuteHandleGeometry_.length];
      System.arraycopy (minuteHandleGeometry_, 0, geometry, 0,
                        minuteHandleGeometry_.length);
      m = new Matrix4x4();
      m.rotateZ (minuteAngle);
      m.translate (x0_, y0_, 0.0);      
      m.transformXyPoints (geometry);
      minuteHandle_.setGeometryXy (geometry);

      geometry = new double[secondHandleGeometry_.length];
      System.arraycopy (secondHandleGeometry_, 0, geometry, 0,
                        secondHandleGeometry_.length);
      m = new Matrix4x4();
      m.rotateZ (secondAngle);
      m.translate (x0_, y0_, 0.0);      
      m.transformXyPoints (geometry);
      secondHandle_.setGeometryXy (geometry);
    }
    
    public void draw()
    {
      background_.setGeometryXy (Geometry.createCircle (x0_, y0_, radius_ * 1.2));
      disc_.setGeometryXy (Geometry.createCircle (x0_, y0_, radius_));

      for (int i = 0; i < 60; i++) {
        double x0 = radius_ * (i % 5 == 0 ? 0.88 : 0.92);
        double x1 = radius_ * 0.98;
        
        double[] geometry = new double[] {x0, 0, x1, 0};
        Matrix4x4 m = new Matrix4x4();
        m.rotateZ (2.0 * Math.PI * i / 60.0);
        m.translate (x0_, y0_, 0.0);
        m.transformXyPoints (geometry);
        ticks_[i].setGeometryXy (geometry);
      }

      for (int i = 0; i < 12; i++) {
        double[] geometry = new double[] {radius_ * 0.75, 0};        

        Matrix4x4 m = new Matrix4x4();
        m.rotateZ (2.0 * Math.PI * i / 12.0);
        m.translate (x0_, y0_, 0.0);
        m.transformXyPoints (geometry);

        labels_[i].setGeometryXy (geometry);
      }

      brand_.setGeometry (x0_, y0_ - radius_ * 0.3);
      
      update();
    }
  }
 
  private class Ticker extends TimerTask
  {
    private GClock clock_;
    
    public Ticker (GClock clock)
    {
      clock_ = clock;
    }
    
    public void run()
    {
      clock_.update();
      clock_.refresh();
    }
  }

  public static void main (String[] args)
  {
    new Demo23();
  }
</pre><p>The post <a href="https://studentprojects.in/software-development/java/java-programs/advanced/java-program-to-display-a-clock/">Java program to display a clock</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-to-display-a-clock/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Java Program for calculator</title>
		<link>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-for-calculator/</link>
					<comments>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-for-calculator/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Thu, 03 Dec 2009 11:41:13 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[download codes]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[java calculator]]></category>
		<category><![CDATA[calculator]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=971</guid>

					<description><![CDATA[<p>JPanel p = new JPanel();<br />
    p.setLayout(new GridLayout(4, 4));<br />
    String buttons = "789/456*123-0.=+";<br />
    for (int i = 0; i < buttons.length(); i++)
      addButton(p, buttons.substring(i, i + 1));
    add(p, "Center");
</p>
<p>The post <a href="https://studentprojects.in/software-development/java/java-programs/advanced/java-program-for-calculator/">Java Program for calculator</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Program by Avinash Kumar Pandey</p>
<pre lang="java">
import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Container;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JApplet;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class PopupCalculatorApplet extends JApplet implements ActionListener {
  public void init() {
    Button calcButton = new Button("Calculator");
    calcButton.addActionListener(this);
    Container contentPane = getContentPane();
    contentPane.add(calcButton);
  }

  public void actionPerformed(ActionEvent evt) {
    if (calc.isVisible())
      calc.setVisible(false);
    else
      calc.show();
  }

  private JFrame calc = new CalculatorFrame();
}

class CalculatorPanel extends JPanel implements ActionListener {
  public CalculatorPanel() {
    setLayout(new BorderLayout());

    display = new JTextField("0");
    display.setEditable(false);
    add(display, "North");

    JPanel p = new JPanel();
    p.setLayout(new GridLayout(4, 4));
    String buttons = "789/456*123-0.=+";
    for (int i = 0; i < buttons.length(); i++)
      addButton(p, buttons.substring(i, i + 1));
    add(p, "Center");
  }

  private void addButton(Container c, String s) {
    JButton b = new JButton(s);
    c.add(b);
    b.addActionListener(this);
  }

  public void actionPerformed(ActionEvent evt) {
    String s = evt.getActionCommand();
    if ('0' <= s.charAt(0) &#038;&#038; s.charAt(0) <= '9' || s.equals(".")) {
      if (start)
        display.setText(s);
      else
        display.setText(display.getText() + s);
      start = false;
    } else {
      if (start) {
        if (s.equals("-")) {
          display.setText(s);
          start = false;
        } else
          op = s;
      } else {
        calculate(Double.parseDouble(display.getText()));
        op = s;
        start = true;
      }
    }
  }

  public void calculate(double n) {
    if (op.equals("+"))
      arg += n;
    else if (op.equals("-"))
      arg -= n;
    else if (op.equals("*"))
      arg *= n;
    else if (op.equals("/"))
      arg /= n;
    else if (op.equals("="))
      arg = n;
    display.setText("" + arg);
  }

  private JTextField display;

  private double arg = 0;

  private String op = "=";

  private boolean start = true;
}

class CalculatorFrame extends JFrame {
  public CalculatorFrame() {
    setTitle("Calculator");
    setSize(200, 200);

    Container contentPane = getContentPane();
    contentPane.add(new CalculatorPanel());
  }
}
</pre><p>The post <a href="https://studentprojects.in/software-development/java/java-programs/advanced/java-program-for-calculator/">Java Program for calculator</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-for-calculator/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Java program of Client-Server network for Chatting between Client and Server</title>
		<link>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-of-client-server-network-for-chatting-between-client-and-server/</link>
					<comments>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-of-client-server-network-for-chatting-between-client-and-server/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Sun, 04 Oct 2009 16:21:21 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[client server in java]]></category>
		<category><![CDATA[chat in java]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[client s]]></category>
		<category><![CDATA[chat between client and server]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=908</guid>

					<description><![CDATA[<p>BufferedReader cin=newBufferedReader(newInputStreamReader(sk.getInputStream()));<br />
PrintStream cout=new PrintStream(sk.getOutputStream());<br />
BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));</p>
<p>The post <a href="https://studentprojects.in/software-development/java/java-programs/advanced/java-program-of-client-server-network-for-chatting-between-client-and-server/">Java program of Client-Server network for Chatting between Client and Server</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<pre lang="java" escaped="true" line="1">
import java.net.*;
import java.io.*;

public class  chatserver
{
	public static void main(String args[]) throws Exception
	{
		ServerSocket ss=new ServerSocket(2000);
		Socket sk=ss.accept();
		BufferedReader cin=newBufferedReader(newInputStreamReader(sk.getInputStream()));
		PrintStream cout=new PrintStream(sk.getOutputStream());
		BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));
		String s;
		while (  true )
		{
			s=cin.readLine();
  			if (s.equalsIgnoreCase("END"))
  			{
				cout.println("BYE");
    				break;
  			  }
			System. out.print("Client : "+s+"\n");
			System.out.print("Server : ");
			s=stdin.readLine();
			cout.println(s);
		}
		ss.close();
 		sk.close();
 		cin.close();
		cout.close();
 		stdin.close();
	}
}

public class  chatclient
{
	public static void main(String args[]) throws Exception
	{
		Socket sk=new Socket("192.168.0.19",2000);
		BufferedReader sin=new BufferedReader(new InputStreamReader(sk.getInputStream()));
		PrintStream sout=new PrintStream(sk.getOutputStream());
		BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));
		String s;
		while (  true )
		{
			System.out.print("Client : ");
			s=stdin.readLine();
			sout.println(s);
			s=sin.readLine();
			System.out.print("Server : "+s+"\n");
  			if ( s.equalsIgnoreCase("BYE") )
 			   break;
		}
		 sk.close();
		 sin.close();
		 sout.close();
 		stdin.close();
	}
}
</pre>
<p><strong>Output:</strong></p>
<p>Java chatclient</p>
<p>From Server :  Hi<br />
From Client: Hi<br />
From Server: Good morning<br />
From Client: End<br />
From Server:Bye</p><p>The post <a href="https://studentprojects.in/software-development/java/java-programs/advanced/java-program-of-client-server-network-for-chatting-between-client-and-server/">Java program of Client-Server network for Chatting between Client and Server</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-of-client-server-network-for-chatting-between-client-and-server/feed/</wfw:commentRss>
			<slash:comments>33</slash:comments>
		
		
			</item>
		<item>
		<title>Java program that finds the area of a circle using Client-Server network</title>
		<link>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-that-finds-the-area-of-a-circle-using-client-server-network/</link>
					<comments>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-that-finds-the-area-of-a-circle-using-client-server-network/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Sun, 04 Oct 2009 16:19:18 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[area of circle calculation]]></category>
		<category><![CDATA[client server in java]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=906</guid>

					<description><![CDATA[<p>ServerSocket ss=new ServerSocket(2000);<br />
		Socket s=ss.accept();<br />
		BufferedReader br=new BufferedReader(newInputStreamReader(s.getInputStream()));<br />
		double rad,area;<br />
		String result;</p>
<p>The post <a href="https://studentprojects.in/software-development/java/java-programs/advanced/java-program-that-finds-the-area-of-a-circle-using-client-server-network/">Java program that finds the area of a circle using Client-Server network</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<pre lang="java" escaped="true" line="1">
import java.net.*;
import java.io.*;
public class  server
{
	public static void main(String args[]) throws Exception
	{
		ServerSocket ss=new ServerSocket(2000);
		Socket s=ss.accept();
		BufferedReader br=new BufferedReader(newInputStreamReader(s.getInputStream()));
		double rad,area;
		String result;
		rad=Double.parseDouble(br.readLine());
		System.out.println("From Client : "+rad);
		area=Math.PI*rad*rad;
		result="Area is "+area;	
		PrintStream ps=new PrintStream(s.getOutputStream());
		ps.println(result);
		br.close();
		ps.close();
		s.close();
		ss.close();
	}
}
public class  client
{
	public static void main(String args[]) throws Exception
	{

		Socket s=new Socket("192.168.0.19",2000);
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String rad;
		System.out.println("Enter radius of the circle ");
		rad=br.readLine();
		PrintStream ps=new PrintStream(s.getOutputStream());
		ps.println(rad);
		BufferedReader fs=newBufferedReader(new InputStreamReader(s.getInputStream()));
		String result=fs.readLine();
		System.out.println("From Server : "+result);
		br.close();
		fs.close();	
		ps.close();
		s.close();
	}
}
</pre>
<p><strong>Output:</strong></p>
<p>Java client</p>
<p>Enter radius of the circle<br />
10<br />
From Server: Area is 314.1341345</p><p>The post <a href="https://studentprojects.in/software-development/java/java-programs/advanced/java-program-that-finds-the-area-of-a-circle-using-client-server-network/">Java program that finds the area of a circle using Client-Server network</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/java/java-programs/advanced/java-program-that-finds-the-area-of-a-circle-using-client-server-network/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
