CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2002
    Posts
    157

    Need Help With Applet

    I have a java applet in which I must draw graphics (such as rectangles) and also place buttons. I am able to draw the graphics, but I do not know how to place the buttons. Can anyone help?

    I am using the Graphics class in the paint method to draw the rectangles. Example:

    Code:
    public void paint(Graphics g)
    {
         g.drawRect(30, 30, 100, 100);
    }
    What classes/methods do I use to place buttons? And which classes to I need to import?

    Thanks!

  2. #2
    Join Date
    Sep 2004
    Posts
    247

    Re: Need Help With Applet

    I suggest you have a read of this tutorial from Sun. It begins to describe how you can add AWT components (such as buttons) onto your applet.

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