抽象方法drawSting(String ,int ,int )也类似

解决方案 »

  1.   

    Graphics有实现,不过我不知道具体类名
      

  2.   

    The Graphics class is the abstract base class for all graphics contexts that allow an application to draw onto components that are realized on various devices, as well as onto off-screen images.
      

  3.   

    public abstract class StaticOne { /**
     * 
     */
    public StaticOne() {
    super();
    // TODO Auto-generated constructor stub
    }
    public static void sayHello() {
    System.out.println("hello, i am from a static method of a static class");
    }}public class Hello { /**
     * 
     */
    public Hello() {
    super();
    StaticOne.sayHello();
    } public static void main(String[] args) {
    new Hello();
    }
    }output:
    hello, i am from a static method of a static class
      

  4.   

    好像是用的Graphics2D的对象画的
      

  5.   

    可是我没有引如Graphics2D他也能实现画线功能啊.
      

  6.   

    你在你的Paint方法中看看
    public void paint(Graphics g)
    {
    g.drawString(g.getClass().getName(),50,50);
    g.drawLine(10,10,85,98);
    }你就会发现真正的Graphics的实现类是在什么地方,