Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. Graphics gp = new Graphics();
  2.  
  3. import java.awt.Graphics;
  4. public abstract class GUI extends Graphics{
  5.  
  6. public void painter(){
  7. GUI gp = new GUI();
  8. gp.drawString("Hello People!",2,10);
  9. }
  10. }
  11.  
  12. class GUI extends JComponent {
  13. public void paintComponent(Graphics g) {
  14. super.paintComponent(g);
  15.  
  16. g.drawString("Hello People!", 2, 10);
  17. }
  18. }
  19.  
  20. import java.awt.Graphics;
  21. public class GUI extends Graphics{
  22.  
  23. public void painter(){
  24. GUI gp = new GUI();
  25. gp.drawString("Hello People!",2,10);
  26. }
  27. }
  28.  
  29. public abstract class GraphicObject {
  30. // declare fields
  31. //declare nonabstract methods
  32. abstract void draw(); }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement