Switch to full style
Graphics and animation Java code examples
Post a reply

Positions X-Y parameters to text drawing methods

Thu Feb 07, 2013 8:55 pm

Positions X-Y parameters to text drawing methods
java code
import java.awt.*;
import java.applet.Applet;

/*
* Very simple applet that illustrates parameters to text-drawing methods.
*/

public class TextXY extends Applet {

public void init() {
validate();
}

public void paint(Graphics g) {
Dimension d = size();

g.drawString("My Text at (4, 6)", 4, 6);
g.drawString("My Text at (3, 31)", 3, 31);
g.drawString("My Text at (3, height)", 3, d.height);
}
}




Post a reply
  Related Posts  to : Positions X-Y parameters to text drawing methods
 Able to Copy Text from Uneditable Text Boxes(JTextfields)     -  
 Which methods is best for SEO?     -  
 What Are Constructor Methods?     -  
 methods in ActionListener interface     -  
 Calling Overloaded Methods     -  
 JSP Passing Arrays to Methods     -  
 Static Methods and Variables     -  
 Can we override static methods in java     -  
 methods with variable arguments list     -  
 Program to compute commission using two methods     -  

Topic Tags

Java Graphics