Article View: borland.public.jbuilder.java.swing
Article #356Re: overridden JTextField in JDialog
From: Hiroshi Nakata
Date: Mon, 05 Sep 2005 13:18
Date: Mon, 05 Sep 2005 13:18
33 lines
2373 bytes
2373 bytes
"Kevin Dean [TeamB]" <NkOdSePaAnM@datadevelopment.com> wrote: >Hiroshi wrote: > >> Hi everyone, a JTextField in a JDialog (or its extended class)ends up >> with mostly-overridden by paint() for the dialog. Below is the code >> to demonstrate the problem. When paint() is not included in the >> dialog class, the field is normally shown, but with it, the field is >> almost lost. Will you tell me why and how I can avoid this problem? >> (I do need to include paint() in the dialog class.) Thank you. > >Unless you're doing something special to the way the dialog (or any >component for that matter) is displayed, you should never have to >override the paint() method. Furthermore, when overriding the paint() >method, you should call the inherited paint() method which in the >dialog's case ensures that all contained components are painted >properly. > Thanks Kevin. Yes, I found a statement in a book saying that paintComponent() should be used instead of paint(). I am going to try the method instead. >-- >Kevin Dean [TeamB] >Dolphin Data Development Ltd. >http://www.datadevelopment.com/ > >NEW WHITEPAPERS >Team Development with JBuilder and Borland Enterprise Server >Securing Borland Enterprise Server >http://www.datadevelopment.com/papers/index.html > >Please see Borland's newsgroup guidelines at >http://info.borland.com/newsgroups/guide.html
Technical Details
Message-ID:
<431c45a8$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!newsprint.newsread.com!63.218.45.11.MISMATCH!nx02.iad01.newshosting.com!newshosting.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<43112344$1@newsgroups.borland.com> <xn0e6lt523it6i004-kdean@www.teamb.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,bf940752da9e232e X-Google-Attributes: gid111d45,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Hiroshi Nakata" <hiroshinakata@hotmail.com> Sender: "Hiroshi Nakata" <hiroshinakata@hotmail.com> Reply-To: "Hiroshi Nakata" <hiroshinakata@hotmail.com> Subject: Re: overridden JTextField in JDialog Newsgroups: borland.public.jbuilder.java.swing X-User-Info: 69.192.157.16 References: <43112344$1@newsgroups.borland.com> <xn0e6lt523it6i004-kdean@www.teamb.com> NNTP-Posting-Host: 207.105.83.66 Message-ID: <431c45a8$1@newsgroups.borland.com> Date: 5 Sep 2005 06:18:32 -0700 X-Trace: newsgroups.borland.com 1125926312 207.105.83.66 (5 Sep 2005 06:18:32 -0700) Lines: 34 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!newsprint.newsread.com!63.218.45.11.MISMATCH!nx02.iad01.newshosting.com!newshosting.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail