 |
|
|
|
| |
|
Total Source Downloaded: 99,295 |
| |
|
Total Snippet Views: 59,399 |
| |
|
New Member: alnahas1 |
| |
|
|
|
|
|
|
| Site Information |
 |
Members |
393 |
 |
Total Downloads |
142 |
 |
Total Snippets |
132 |
|
|
|
|
|
|
|
 |
| Submit your source code and code snippets to Cy2online and
help build an archive of source code. Click here
register or login if you are a member.
|
 |
Submit Snippets |
|
|
|
|
|
|
|
|
|
 |
| 57 |
Rectangle Class - Java |
| Version: JRE 1.4 |
| This snippet contains 2 class's with two main methods. You need to save the seperatly. The snippet demonstrates how to draw a rectangle. |
| Import/Using Directives |
| None |
public class Rectangle
{
private double width = 1;
private double height = 1;
private static String color = "white";
public Rectangle() { }
public Rectangle(double w, double h, String c)
{
width = w;
height = h;
color = c;
}
public double getWidth() { return width; }
public void setWidth(double w) { width = w; }
public double getHeight() { return height; }
public void setHeight(double h) { height = h; }
public static String getColor() { return color; }
public static void setColor(String c) { color = c; }
public double findArea() { return height * width; }
}
// ClientProgram.java
public class ClientProgram
{
public static void main(String args[])
{
Rectangle mySquare = new Rectangle(5, 5, "green");
System.out.print("\n Height = " + mySquare.getHeight() );
System.out.print("\n Width = " + mySquare.getWidth() );
System.out.print("\n Color = " + mySquare.getColor() );
mySquare.setHeight(10);
mySquare.setWidth(15);
System.out.print("\n\n Height = " + mySquare.getHeight() );
System.out.print("\n Width = " + mySquare.getWidth() );
System.out.print("\n Area = " + mySquare.findArea() );
}
} |
|
|
|
 |
| 1 |
Simple DataGridView Example - C# |
| This example demonstrates how to load data into the DataGridView control using string array's. |
| 2 |
A Custom Message Box - C# |
| This example source code demonstrates how you can develop your own messages box. |
| 3 |
Custom MessageBox 2 - C# |
| This example source code builds on a previous example of creating a custom MessageBox. New features in this example include different types of buttons and displaying an icon. Also uses different message beep tones for standard MessageBox's and warring MessageBox's. |
| 4 |
Connect To MSN Messenger Using The MSN Protocol - C# |
| This sample application demonstrates how to connect to MSN Messenger using the MSN Protocol. It also includes how to generate a Ticket that is used with the ChallengeString. This is a simple authentication example. |
| 5 |
Send Messages Using The Net Send Command - C# |
| This sample program demonstrates how to send messages in a network using the Windows Messenger service. |
|
|
|
|
|
|
CY2 Online2.net | CopyRight 2005 - 2007 | All Rights Reserved
|
|