Programming in Java
Object Oriented in Java
Advanced topics in Java
Modal Box
Tutorials
C is a very powerful and widely used language. It is used in many scientific programming situations. It forms (or is the basis for) the core of the modern languages Java and C++. It allows you access to the bare bones of your computer.C++ is used for operating systems, games, embedded software, autonomous cars and medical technology, as well as many other applications. Don't forget to visit this section...
Applet in java
Applet are intelligent programs that are used to load dynamic content in the webpage.
applet run on client side browser and they don’t need the main method to run.
applet has its own life cycle as the following methods :
1. init()
2. start()
3. paint()
4. stop()
5. destroy()
All Applet classes need to extend Applet class .
Applet class needs to be declared as public so, we need to save with the same as class name.
Applet class is embedded in the browser by using applet tag. For Applet class, the package java.applet needs to be imported.
Applet class is embedded in the browser by using applet tag. For Applet class, the package java.applet needs to be imported.
Applet program for painting some shapes :
import java.applet.*; import java.awt.*; /*<applet code="MyApplet" width=600 height=400>
</applet>*/ public class MyApplet extends Applet { public void paint(Graphics g) { g.drawString("welcome to applet",200,200); g.drawLine(300,150,400,400);// two points x and y co-ordintates g.drawRect(50,50,300,300); //First point co-ordinates and third point co-ordinates. } }
By command line applet class may be run by appletviewer command as following :
> appletviewer MyApplet.java
⇒ out put is shown in 600 pixels as width and 400 as height windows of applet.
⇒ AWT controls like Button , Label etc may also be used for GUI programming design.
Video/ C Introduction
Watch video in full size