呵呵,这个用VBA或者.NET Framework也许可以做到

解决方案 »

  1.   

    //a demo
    public void paint(Graphics g){
        Graphics2D g2=(Graphics2D) g;
        Font font=new Font("FangSong",Font.PLAIN,90);
        FontRenderContext frc = g2.getFontRenderContext();
        TextLayout tl = new TextLayout("空心", font, frc);
        Shape sh=tl.getOutline(null);
        AffineTransform t= new AffineTransform();
        t.setTransform(0.7,0,0,0.7,40,180);
        sh=tl.getOutline(t);
        g2.draw(sh);
    ...
      

  2.   

    to:wobelisk()你的方法我已经实现了
    可是考虑到效率,如果每输入一个字把它设为空心,不是每次都有new TextLayout了吗?
      

  3.   

    不知道用GeneralPath能不能实现
      

  4.   

    let's see the definition:
    public Shape getOutline(AffineTransform tx) {
            GeneralPath dstShape = new GeneralPath(GeneralPath.WIND_NON_ZERO);
        .....
            return dstShape;
    }
    In fact, you used GereralPath to do this assignment. 
      

  5.   

    to wobelisk():
    受到你的启发我自己也实现了一个方法;
    public void paint(Graphics g)
    {
        Graphics2D g2 = (Graphics)g;
        Font font = g2.getFont();
        FontRenderContext frc = g2.getFontRenderContext();
        GlyphVector gv = font.create(frc, "学要空心处理的文字");
        Shape outline = gv.getOutline(x, y);
        g2.draw(outline);
    }不知道这个方法在性能上会不会比你的好一些
      

  6.   

    GlyphVector gv = font.create(frc, "学要空心处理的文字");
    上面那句错的应该是GlyphVector gv = font.createGlyphVector(frc, "需要空心处理的文字");
      

  7.   

    用java做个画图程序吧画两个一个大一个小不就解决了。呵呵,不过要是真的能实现好像要做控件了。