Skip to content

Painting JLabel with border not showing text but filled rectangle #25

@markustw

Description

@markustw

Creating SVG of a JLabel with a colored border with SVGGraphics2D paints a filled rectangle in the size of the label instead of a text surrounded by a rectangle:

JLabel label = new JLabel("Label with border");
label.setBorder(BorderFactory.createLineBorder(Color.YELLOW)); // removing border shows text
label.setSize(label.getPreferredSize());

SVGGraphics2D graphics = new SVGGraphics2D(100, 40);
label.printAll(graphics);

Sorry for filing in another issue. We just tested JFreeSVG for generating SVG in our application. This and issue #24 are the two major issues we found.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions