I Forgot to mention that, but I did override the paintComponent() method like this :

 public void paintComponent(Graphics g){
        super.paintComponent(g);
        update(g);
    }
    public void update(Graphics g){
        Graphics2D g2D = (Graphics2D) g;
        Dimension dim = getSize();
        int w = dim.width;
        int h = dim.height;
        if (firstTime){
            firstTime = false;
            bi = (BufferedImage) createImage(w,h);
            big = bi.createGraphics();
            area = new Rectangle(dim);
        }
        big.setColor(Color.white);
        big.clearRect(0,0,w,h);
...
 and so on, calling the big.draw(A_Shape_Object) method to paint what I want to be draw in the window. But that only works with Shape objects. I want to know how do I make this with JTextArea Objects and another javax.swing... elements that I want to be show in the window. I've tryied to just use the setLocation in the object, position it in some cordinate of the show area, but it doesn't appear =/ don't know what can I do.

Hope I'm not being problem, but I need help with this and don't know where can I go search some but here. Well, thx anyway ^^

On 4/20/06, Chet Haase < [EMAIL PROTECTED]> wrote:

You need to override paintComponent(), not paint().  If you override
paint(), you need to draw the children of the current component
yourself (paint draws borders, children, etc.).  But if you override
paintComponent(), then your responsible only for the component's
contents, and Swing will handle the children.

Chet.


[ Fenrir Northern Wolf ] wrote:
> Hey ppl. I'm getting problems to show a JTextArea in an applet that I'm
> working on, and I hope someone can help me.
>
> Well, my application is like windows "Paint". You can draw some shapes
> in it, and can move, reshape it, cause I save every shape reference. And
> to draw it I overrided the repaint() method and there I do all the
> drawing needed to all the shapes appear in a Graphics2D "area", but I'm
> having problem to make JTextAreas appear. I don't know if I'm making
> myself clear, my engilish doesn't help too much, but I want to know what
> I have to do to "draw" the JTextAreas. They don't appear, even if I
> position them in a absolute pos with setLocation method inherited from
> Componet class. Someone can help me?
>
> Ah.. it's a JPanel that I'm drawing into. If it's not to clear what I
> said, plz reply explaining what you didn't understand, I will try to
> explain better then. Well, thx anyway o/
>
> --
> What said Odin to the Gods and to the Champions who surrounded him? "We
> will give our lives and let our world be destroyed, but we will battle
> so that these evil powers will not live after us." Out of Hel's ship
> sprang Fenrir the Wolf. His mouth gaped; his lower jaw hung against the
> earth, and his upper jaw scraped the sky. Against the Wolf Odin
> All-Father fought...
>
> ...By Fenrir the Wolf Odin was slain.
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body of the message "signoff JAVA2D-INTEREST". For general help, send
> email to [EMAIL PROTECTED] and include in the body of the message
> "help".



--
What said Odin to the Gods and to the Champions who surrounded him? "We will give our lives and let our world be destroyed, but we will battle so that these evil powers will not live after us." Out of Hel's ship sprang Fenrir the Wolf. His mouth gaped; his lower jaw hung against the earth, and his upper jaw scraped the sky. Against the Wolf Odin All-Father fought...

...By Fenrir the Wolf Odin was slain. =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to