Topic - Applet Communication
Languages Used - Java(AWT + Swing)
- Pradeep Gangwar
- Ripuvendra Singh
- Sashank Mishra
- Shreyansh Dwivedi
- Siddharth Simharaju
The project asks us to show communication between two applets. An applet is a program that works on a web page using HTML link.
This project was a way to explore the application of Object Oriented approach in Graphical User Environment, and also to explore the applets through Java language.
The project is implemented in two instances: Core AWT and AWT + Swing. The AWT instance works via appletviewer, while the Swing instance works via Java NetBeans.
In this project we have, created two applets, EnterShapeApplet and ShapeColorApplet. These applets are made to communicate with each other. The first applet EnterShapeApplet takes in the dimensions of the shape and allows us to pick a color. The second applet shows the shapes which we have given as input. The shapes in the second applet undergo a transition from one shape to another shape and the color of the shapes is the one we selected in first applet.
The transition of the shapes is done in an separate thread(so as to prevent the transition function to block the main thread). This is done using java.util.Timer .
After we run the program, the two applets open and the first applet takes input and the second applet shows the transition of the shapes.
- Enter the RGB valid values(in AWT instance), or select color from ColorChooser (in Swing instance).
- Select size of the shapes(if entered none, default value is 10);
- Press ‘Start’ button.
- Transition of shapes start in the second applet, which shows three shapes, Rectangle, Triangle and Circle, in an interval of 1 second.
- Press ‘Stop’ button in first applet to stop the transition in the second applet.