๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

RE: new component

#7734
From: facundo
Date: Mon, 21 May 2001 13:58
29 lines
1883 bytes
I'm writing my souce code in MouseClick event from another button.
I've tried "this.getContentPane().add()"  but I still can't see my new
button.


rp <admin@objectpascal.com> escribi๏ฟฝ en el mensaje de noticias
3b06ff09$1_1@dnews...
> In your MouseListener the "this" reference will be pointing at your
> MouseListener inner class or would that be your ActionListener? Is the
> method name actionPerformed(ActionEvent e) ?
> In anycase you need to add the button to a ContentPane
> this.getContentPane().add() if you are not in an inner listener class.
> and depending on the LayoutManager you may need to set prefered size, min
> size, max size.
>
>
>
> "facundo" <fakkundo@hotmail.com> wrote in message news:3b054d39_1@dnews...
> > How can I create a new component at run time?
> > I've tried to writing this in MouseClick event of a button:
> >
> > JButton button2 = new JButton();
> > this.add(button2);
> >
> > but I can't see the button, I think I'm missing something.
> >
> >
>
>
Technical Details
Message-ID: <3b091e7b_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.uni2.dk!newssuck.uni2.dk!dnews
References: <3b054d39_1@dnews> <3b06ff09$1_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f74b3,731295f9facb01cf
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-05-21 07:01:04 PST
From: "facundo" <fakkundo@hotmail.com>
Newsgroups: borland.public.jbuilder.java.language
References: <3b054d39_1@dnews> <3b06ff09$1_1@dnews>
Subject: RE: new component
Date: Mon, 21 May 2001 10:58:15 -0300
Lines: 31
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
NNTP-Posting-Host: 200.32.13.186
Message-ID: <3b091e7b_2@dnews>
X-Trace: dnews 990453371 200.32.13.186 (21 May 2001 06:56:11 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.uni2.dk!newssuck.uni2.dk!dnews