Package javax.swing

Examples of javax.swing.JComponent.paint()


                                // Composite for
                                // the
                                // Graphics2D
                                // context
          lbl.setOpaque(false);
          lbl.paint(graphics); // painting the graphics to label
          graphics.dispose();
        }
        dragSource.startDrag(dge, DragSource.DefaultMoveNoDrop, image,
            new Point(0, 0), new TransferableNode(draggedNode),
            this);
View Full Code Here


    f.setContentPane(c);
    f.setSize(100, 100);
    f.setVisible(true);
    callOrder.delete(0, callOrder.length());
    Graphics g = c.getGraphics();
    c.paint(g);
    // If the components receives multiple paint requests (like the system
    // triggers a repaint), then we might get 123123123 or something. To avoid
    // trouble like this, we check using startsWith().
    harness.check(callOrder.toString().startsWith("123"));
    f.dispose();
View Full Code Here

    protected void paintComponent(Graphics g) {
        if(isVisible()) {
            if(trackRenderer != null) {
                JComponent comp = trackRenderer.getRendererComponent(this);
                add(comp);
                comp.paint(g);
                remove(comp);
            } else {
                paintRange((Graphics2D)g);
            }
        }
View Full Code Here

        @Override
        public void paintComponent(Graphics g) {
            if(slider.getThumbRenderer() != null) {
                JComponent comp = getRenderer();
                comp.setSize(this.getSize());
                comp.paint(g);
            } else {
                g.setColor(getBackground());
                g.fillRect(0,0,getWidth(),getHeight());
                if(isSelected()) {
                    g.setColor(Color.black);
View Full Code Here

      BufferedImage image = new BufferedImage(control.getWidth(), control
          .getHeight(), BufferedImage.TYPE_INT_RGB);
      Graphics controlImage = image.getGraphics();
      // JComponent control2 = new JPanel();
      // control2.paint(controlImage);
      control.paint(controlImage);
      // control.repaint();
      // control.repaint(0, 0, control.getWidth(), control.getHeight());
      g.drawImage(image, (int) control.getLocation().getX(),
          (int) control.getLocation().getY(), null);
    }
View Full Code Here

    /* Scales the page so that the width fits. */
    g2.scale(scale, scale);

    /* Repaints the page. */
    componentToPrint.paint(g2);
    return Printable.PAGE_EXISTS;
  }
}
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.