Write a program to design an applet to accept account number and balance in form of parameter and print message "Low Balance" If Balance is low in Java

import java.applet.*;
import java.awt.*;
/*
<applet code="Id2" width=200 height=100>
<param name="no" value="123"/>
<param name="bal" value="345"/>
</applet>
*/
public class Id2 extends Applet
{
int a,b;
public void init()
{
a=Integer.parseInt(getParameter("no"));
b=Integer.parseInt(getParameter("bal"));
}
public void paint(Graphics g)
{
if(b<500)
g.drawString("Low",30,60);
else
g.drawString("High",30,60);
}
}

output:

Comments