.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Jean Paul
satyapriyanayak
ASPEvil
SP
Ashutosh Jha

Home >> Code Snippets >> OOPS >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

java program to print a text using applet

Posted By:laptop charles       Posted Date: June 30, 2010    Points: 10    Category: OOPS    URL: http://www.dotnetspark.com  

print a text.
 

P
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class app1 extends Applet implements ActionListener
{
Label l1;
public void init()
{
l1=new Label("");
Button b1=new Button("ok");
add(l1);
add(b1);
b1.addActionListener(this);
}
  public void paint(Graphics g)
  {
    g.drawString("mother mary",50,50);
   }
public void actionPerformed(ActionEvent e)
{
	Object obj=e.getActionCommand();
if(obj=="ok")
{
	l1.setText("Ave maria");
 	l1.setBounds(100,100,100,100);
}
}
  }
/*
*/
rint a text in particular place

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend