Client Server in Java

Set up a Server that will receive packets from a client and send packets to a client. Also set up a Client that will send packets to a server and receive packets from a server. [sourcecode...

Sketcher

Sketecher Java /******************************************************* * MYCPLUS Sample Code - https://www.mycplus.com * * * * This code is made available as a service to our * * visitors and is provided strictly for the * * purpose of illustration. * * * * Please...

Bank Operations using Threads in Java

Bank Operation demo that uses Bank, Clerk and Account and Transaction objects to complete the operation. Actually this demo shows how you can use threads to perform the tasks intheir own capicity and utilise the maximum system resopurces. What we do is, we have two...

Calculator

A simple Java Calculator Java /******************************************************* * MYCPLUS Sample Code - https://www.mycplus.com * * * * This code is made available as a service to our * * visitors and is provided strictly for the * * purpose of illustration. *...

Java network chat Applet

This applet simulates a network chat, in which the user chats with someone over a network. Here, there is no network. The partner is simulated by a thread that emits strings at random. The point of the simulation is to show how to use a separate thread for receiving...

Drawing Pad

A simple Drawing Pad on which the user can draw some lines and shaps by using the mouse. Java /******************************************************* * MYCPLUS Sample Code - https://www.mycplus.com * * * * This code is made available as a service to our * * visitors...

Java ChatWindow for two way Chatting

A ChatWindow supports two-way chatting between two users over the Internet. The constructor for a ChatWindow requires a connected Socket. Messages are sent and received through this socket. The window has a text-input box where the user can type messages. When the...

Form

A Java Form class extended from JFrame with few buttons. These buttons show message dialog box when some actions are performed on them. Java /******************************************************* * MYCPLUS Sample Code - https://www.mycplus.com * * * * This code is...

PostFix expression evaluator – Java

This program evaluates postfix expressions entered by the user. The expressions can use non-negative real nubmers and the operators +, -, *, /, and ^ (where ^ represents exponentiation). Numbers must begin with a digit. That is, you have to say 0.7 rather than just...

String Sorting

String Sorting demonstration. Java /******************************************************* * MYCPLUS Sample Code - https://www.mycplus.com * * * * This code is made available as a service to our * * visitors and is provided strictly for the * * purpose of...

Java color chooser Appelt

A ColorChooserApplet shows six scroll bars that the user can manipulate to set the red, gree, blue, hue, brightness, and saturation components of a color. A color patch shows the selected color, and there are six labels that show the numerical values of all the...

JRadioButton Demonstration – Java

A little applet that demonstrates JRadionButton with a group of radio buttons that control the background color of a label. [code=’java’] /******************************************************* * MYCPLUS Sample Code – https://www.mycplus.com * * * *...

Stars Applet

Stars Applet that show some stars on the applet windows. Java /******************************************************* * MYCPLUS Sample Code - https://www.mycplus.com * * * * This code is made available as a service to our * * visitors and is provided strictly for the...

Testing of two components MirrorLabel – MirrorLabel

This applet tests two custom components, MirrorLabel and MirrorLabel . It also tests the validate() method. The user can click a button to change the text on the components in the applet. Clicking another button will validate the applet. This will cause components...

Color Selector

A custom component that lets the user select a color. The available colors are bright, saturated colors in a full range of hues. The possible colors are shown in a strip. The user clicks on this strip to select a color. The selected color is hilited with a white...

Double buffering in Swing – Java

An applet showing a red square that the user can drag with the mouse, on a background of lines. The user can drag the square off the applet and drop it. It will jump back to its starting point. This applet does uses double buffering, which is the default behavior in...

Read the URL – Java

This short program demonstrates the URL and URLConnection classes by attempting to open a connection to a URL and read text from it. The url must be specified on the command line. If an error occurs, a message is output. Otherwise, the text from the URL is copied to...

Show Volumes of Earth and Sun

Show Volumes of Earth and Sun and their ratios Java /******************************************************* * MYCPLUS Sample Code - https://www.mycplus.com * * * * This code is made available as a service to our * * visitors and is provided strictly for the * *...

Dynamic array of integers

An object of class DynamicArrayOfInt acts like an array with unlimited size. The method put(position,value) is used to store the value at the specifed position in the array. There is no pre-set limit on how large position can be, although for very large values there...

RGB Color Chooser Applet – Java

A RGBColorChooser shows three sliders that the user can manipulate to set the red, green, and blue, components of a color. A color patch shows the selected color, and there are three labels that show the numerical values of all the components. Values are in the range...