Article View: borland.public.jbuilder.java.language
Article #20052Components added at runtime won't stay visible on parent repaint
From: Kevin Knappmiller
Date: Fri, 07 Nov 1997 00:00
Date: Fri, 07 Nov 1997 00:00
50 lines
2370 bytes
2370 bytes
Rather than using the method of keeping track of all my sub-components with my own container ala the Sun Draw Demo, I wanted to use the object based power of Java to add and automatically repaint my objects when necessary. Unfortunately this doesn't work and I cannot figure out why. The weirdest thing is that it almost works. When my window layout manager is set to BorderLayout the objects added that are not the default size, redraw, but not the default size objects. No objects repaint when any other layout managers are selected. I thought this was a very interesting little application because it demonstrated the object based power of Java. Trying to figure out why it wasn't working gave me a great deal of insight into the guts of Java. Unfortunately I don't seem to have the tools to figure out what is wrong. If Borland had included the jbcl source I might have been able to figure it out from that. Can someone e-mail me the source to the jbcl ShapeControl component? I was able to add it at run time and it repainted OK, so there is something required that I am missing. I suspect that it has to do with the peer, but can find little or nothing on this subject on the documentation. When running the application in the debugger, the component paints fine the second time, but when it is called from the parent's paintComponent it seems to be underneath the parent rather than being visible. Is there a way to compile in debug information to the java.awt so that one can debug into awt class methods? I would be happy to email the source to anyone who was interested in taking a look at this problem. I would attach it to this message, but this news server seems to invalidate any messages with attachments. Any clues or the jbcl source to ShapeControl would be appreciated. Sincerely, Kevin Knappmiller kevink@imageline.com
Technical Details
Message-ID:
<63vav2$q2v3@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,44566b24d7c1536c,start X-Google-Attributes: gidf74b3,public From: "Kevin Knappmiller" <kevink@imageline.com> Subject: Components added at runtime won't stay visible on parent repaint Date: 1997/11/07 Message-ID: <63vav2$q2v3@forums.borland.com> X-Deja-AN: 287689471 X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 Organization: None Newsgroups: borland.public.jbuilder.java.language