Paint method problem


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Paint method problem

  1. #1
    Join Date
    Mar 2005
    Posts
    6

    Paint method problem

    Ive created an applet in java for which displays images on a canvas, it also has panels for the buttons and components. I have used the paint method for displaying the images. The problem I'm haveing is that when I run the applet the panels are painted over, such that only the buttons are visible but the panels borders are just painted over.

  2. #2
    Join Date
    Mar 2005
    Location
    Airzona
    Posts
    7
    maybe you have something in the paint methond before you painted the panals that is painting over them maybe look and move stuff around

  3. #3
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560

    Been there, never done that...

    Tie Ninja is absolutely right, but getting around this problem is difficult...

    Ive coded java for 10 years and I have never been able to do that properly, but, if you manage then please let me know how you did it.
    Until then I proclaim (hehe) :

    You should not add standard components to a container where you have
    overridden the paint method.


    I advise you to set up your applet with a borderlayout, and a panel in south
    for your buttons and in the center you add your own panel extension (where
    you have overridden the paint method).
    eschew obfuscation

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center