Java Code Examples for javax.swing.JComponent.print()

The following are Jave code examples for showing how to use print() of the javax.swing.JComponent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: incubator-netbeans   File: ComponentPanel.java   View Source Code Vote up 5 votes
@Override
    public void print(Graphics g) {
        for (JComponent component : myComponents) {
            component.print(g);
//          g.setColor(java.awt.Color.green);
//          g.drawRect(0, 0, getWidth(component), getHeight(component));
            g.translate(getWidth(component), 0);
        }
    }
 
Example 2
Project: jdk8u-jdk   File: bug4337267.java   View Source Code Vote up 4 votes
void printComponent(JComponent c, TestBufferedImage i) {
    Graphics g = i.getGraphics();
    g.setColor(c.getBackground());
    g.fillRect(0, 0, i.getWidth(), i.getHeight());
    c.print(g);
}
 
Example 3
Project: openjdk-jdk10   File: bug4337267.java   View Source Code Vote up 4 votes
void printComponent(JComponent c, TestBufferedImage i) {
    Graphics g = i.getGraphics();
    g.setColor(c.getBackground());
    g.fillRect(0, 0, i.getWidth(), i.getHeight());
    c.print(g);
}