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

Thread: draw image

  1. #1
    Guest

    draw image

    Hi, frend:
    I need to draw an image in a Panel as Panel background. Can any body help me?
    I use awt.
    Thank you very much.


  2. #2
    Join Date
    Mar 2000
    Location
    Portland, OR, USA
    Posts
    41

    Re: draw image

    You can create sublclass of Panel class and override its paint() method, like:


    public class MyPanel extends java.awt.Panel
    {
    public void paint(Graphics gr)
    {
    // any graphics operations, for example:
    gr.drawLine(...);
    }
    }




    After that you have to use instance of your MyPanel class in your application.



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