🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #8880

Re: Paintproblem

#8880
From: Paul Furbacher [TeamB]
Date: Mon, 10 Jul 2000 00:00
36 lines
1697 bytes
sven goetgeluck wrote:
> 
> Hi have designd a "button" that extends a canvas for drawing
> imagebuttons like in ie and sort so when you enter with mouse or click
> other imgages are displayed on the button but when implenting them in
> application into my buttonbar something weird happens
> the buttons look great but when clikking on the menu above them them
> come , display trough the menu
> what can this be
> 
> greeting Sven
> 
> 
> see source :
> 
> 
> import java.awt.event.*;
>   import java.awt.image.*;
>   import java.net.*;
> import java.awt.*;
> 
>   public class ImageButton extends Canvas { ...

My guess is that because you are deriving your ImageButton
from a "heavyweight" (i.e., regular AWT) component, and
your menu is (just guessing) a "lightweight" component
(JMenu, etc.) you are experiencing the "lightweight / heavyweight"
painting problem.  This used to be discussed in the "Hints and
Tips.html" file (haven't look at it recently to know if it 
still is in JBuilder version 3.5).

One solution would be to derive your custom button from 
JComponent. 


Paul Furbacher (TeamB)
Technical Details
Message-ID: <396A386C.B5E574F3@home.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <39698078.B0D4C320@officeline.be>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,1ac40abb3e2e6f3
X-Google-Attributes: gid111d45,public
From: "Paul Furbacher [TeamB]" <pnf@home.com>
Subject: Re: Paintproblem
Date: 2000/07/10
Message-ID: <396A386C.B5E574F3@home.com>
X-Deja-AN: 644761790
Content-Transfer-Encoding: 7bit
References: <39698078.B0D4C320@officeline.be>
X-Accept-Language: en,pdf
Content-Type: text/plain; charset=us-ascii
Organization: Reverse Alchemy, Inc.
Mime-Version: 1.0
Reply-To: pnf@home.com
Newsgroups: borland.public.jbuilder.java.swing