🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #7209

Re: Combine methods

#7209
From: Joi Ellis [TeamB]
Date: Tue, 03 Jul 2001 04:51
39 lines
2156 bytes
KK <kk@hotmail.com> wrote:
> Dear all:

> Is there any solution to combine the following methods into one? Since they
> look similar, I would like to combine them and make the program simplier.

> Ken

> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

>     public void showDlgSimLib() {
>         dlg_ec_simlib dlg = new dlg_ec_simlib(this);
>         Dimension dlgSize = dlg.getPreferredSize();
>         Dimension frmSize = getSize();
>         Point loc = getLocation();
>         dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x,
> (frmSize.height - dlgSize.height) / 2 + loc.y);
>         dlg.show();
>     }

>     public void showDlgSimLib() {
>         dlg_ec_simlib dlg = new dlg_ec_simlib(this);
>         Dimension dlgSize = dlg.getPreferredSize();
>         Dimension frmSize = getSize();
>         Point loc = getLocation();
>         dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x,
> (frmSize.height - dlgSize.height) / 2 + loc.y);
>         dlg.show();
>     }

Uhh.  These two fragments are identical.  Did you intend to paste in
a different fragment?


-- 
Joi Ellis (TeamB)               http://www.teamb.com/
No direct email, please.
For best results, post on news server newsgroups.borland.com!
Newsgroup Info: http://www.borland.com/newsgroups/guide.html
Technical Details
Message-ID: <3b414f60_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!feed2.news.rcn.net!rcn!news.maxwell.syr.edu!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews!not-for-mail
References: <3b414874_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,b25916793f54693d
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-07-02 22:00:15 PST
Message-ID: <3b414f60_2@dnews>
From: "Joi Ellis [TeamB]" <joi@aravox.com>
Subject: Re: Combine methods
Newsgroups: borland.public.jbuilder.java.language
References: <3b414874_1@dnews>
User-Agent: tin/1.4.2-20000205 ("Possession") (UNIX) (Linux/2.2.16-3 (i686))
NNTP-Posting-Host: 209.46.41.66
Date: 2 Jul 2001 21:51:44 -0700
X-Trace: dnews 994135904 209.46.41.66 (2 Jul 2001 21:51:44 -0700)
Lines: 39
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!feed2.news.rcn.net!rcn!news.maxwell.syr.edu!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews!not-for-mail