Package javax.swing

Examples of javax.swing.JLabel.paint()


        // Get a graphics context for this image
        Graphics2D g2 = mGhostImage.createGraphics();

        // Ask the cell renderer to paint itself into the BufferedImage
        lbl2.paint(g2);

        // Use DST_OVER to cause under-painting to occur
        g2.setComposite(AlphaComposite.getInstance(AlphaComposite.DST_OVER,
            0.5f));
View Full Code Here


        // Ask the cell renderer to paint itself into the BufferedImage
        g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC, 0.5f)); // Make
        // the
        // image
        // ghostlike
        lbl.paint(g2);

        // Now paint a gradient UNDER the ghosted JLabel text (but not under the
        // icon if any)
        // Note: this will need tweaking if your icon is not positioned to the
        // left of the text
View Full Code Here

                    g2.dispose();
                }
            }
            g.translate(labelX, labelY);
            label.setSize(labelW, labelH);
            label.paint(g);
            g.translate(-labelX, -labelY);
        }
        else if (border != null) {
            border.paintBorder(c, g, x, y, width, height);
        }
View Full Code Here

       
        g2d.drawImage(img, 0, 0, null);
        g2d.translate(0, imgtext.getHeight() - label.getHeight());
        g2d.setPaint(gpaint);           
        g2d.fillRect(0 , 0, imgtext.getWidth(), label.getHeight());   
        label.paint(g2d);
           
        g2d.dispose();
       
        return imgtext;   
    }
View Full Code Here

                    g2.dispose();
                }
            }
            g.translate(labelX, labelY);
            label.setSize(labelW, labelH);
            label.paint(g);
            g.translate(-labelX, -labelY);
        }
        else if (border != null) {
            border.paintBorder(c, g, x, y, width, height);
        }
View Full Code Here

       
        g2d.drawImage(img, 0, 0, null);
        g2d.translate(0, imgtext.getHeight() - label.getHeight());
        g2d.setPaint(gpaint);           
        g2d.fillRect(0 , 0, imgtext.getWidth(), label.getHeight());   
        label.paint(g2d);
           
        g2d.dispose();
       
        return imgtext;   
    }
View Full Code Here

            // Make the image ghostlike
            g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC, 0.5f));

            // Ask the cell renderer to paint itself into the BufferedImage
            rendererComponent.paint(g2d);

            // Finished with the graphics context now
            g2d.dispose();
        }
       
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.