Article View: be.comp.programming
Article #1804Re: [java] alle elementen in een JPanel disable-en?
From: Passero
Date: Mon, 29 Nov 2004 19:42
Date: Mon, 29 Nov 2004 19:42
30 lines
1898 bytes
1898 bytes
"Daniel Tryba" <spam@tryba.invalid> schreef in bericht
news:41ab768a$0$96429$e4fe514c@dreader3.news.xs4all.nl...
> In nl.comp.programmeren Passero <bla@bla.be> wrote:
> > Hoe kan ik op een eenvoudige manier alle elementen in een JPanel
disable-en?
>
> Volgens de handleiding lijkt
> file:///..../docs/api/java/awt/Container.html#getComponents()
> me het makkelijkst.
>
Ok thx, tis me gelukt. Heb 2 methoden geschreven die het nodige doen:
private void disablePanel(JPanel panel)
{
for(int i=0;i<panel.getComponentCount();i++)
{
panel.getComponent(i).setEnabled(false);
}
}
private void enablePanel(JPanel panel)
{
for(int i=0;i<panel.getComponentCount();i++)
{
panel.getComponent(i).setEnabled(true);
}
}
Technical Details
Message-ID:
<%YKqd.4719$xO1.108651@phobos.telenet-ops.be>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!wns14feed!worldnet.att.net!204.71.34.3!newsfeed.cwix.com!ossa.telenet-ops.be!phobos.telenet-ops.be.POSTED!not-for-mailReferences:
<WlKqd.4647$h37.171108@phobos.telenet-ops.be> <41ab768a$0$96429$e4fe514c@dreader3.news.xs4all.nl>Show Full Headers
Complete Article Headers
X-Google-Thread: fcea4,3f587a8e768798fc X-Google-Thread: 107324,3f587a8e768798fc X-Google-Attributes: gidfcea4,gid107324,public X-Google-Language: DUTCH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!wns14feed!worldnet.att.net!204.71.34.3!newsfeed.cwix.com!ossa.telenet-ops.be!phobos.telenet-ops.be.POSTED!not-for-mail From: "Passero" <bla@bla.be> Newsgroups: be.comp.programming,nl.comp.programmeren References: <WlKqd.4647$h37.171108@phobos.telenet-ops.be> <41ab768a$0$96429$e4fe514c@dreader3.news.xs4all.nl> Subject: Re: [java] alle elementen in een JPanel disable-en? Lines: 32 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: <%YKqd.4719$xO1.108651@phobos.telenet-ops.be> Date: Mon, 29 Nov 2004 19:42:51 GMT NNTP-Posting-Host: 81.165.83.63 X-Complaints-To: abuse@telenet.be X-Trace: phobos.telenet-ops.be 1101757371 81.165.83.63 (Mon, 29 Nov 2004 20:42:51 MET) NNTP-Posting-Date: Mon, 29 Nov 2004 20:42:51 MET Organization: Telenet Internet