CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: paint.

Threaded View

  1. #1
    Join Date
    Sep 2011
    Posts
    197

    paint.

    I suppose my answer lies in a better understanding of paintComponent(graphics g); But, I'll ask it here just incase someone has a direction to point me in I would much appriciate it.

    You see I have some images I want to update at different times. So I need a way of only calling to update certain images. I tried using a layeredPane and, just using another component. But, either way they seem to be called if I update the paint it looks somethign like this.

    Code:
                         bUttonLogic.need = false;
                         JComponent game = new gameEngine(gameEngine.NEW_GAME);
                         JComponent gme = new typeO();
                           gAme = game;
                             machine.add(game);
                             machine.add(gme, -1);
                             machine.pack();


    This code below some how still calls to update the overriden paintComponent in typeO class.
    Code:
    machine.gAme.repaint();
    Thanks ahead of time.


    _______UPDATE _______________

    I am now trying to use printComponent for the other images seems rather inefficeint but, I'm still toying around with how the graphics class is called. I still don't quite understand how the graphics class is called/works.

    I now realize that when I add two components one after another it jsut overrides the previous. I think.
    Last edited by kolt007; March 6th, 2012 at 03:28 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured