Article View: pl.comp.lang.java
Article #152964NetBeans i dynamiczne dodanie JButton do JPanel / JFrame
From: Shuwar
Date: Sat, 15 Oct 2011 18:04
Date: Sat, 15 Oct 2011 18:04
18 lines
1685 bytes
1685 bytes
Probuje dynamicznie po uruchomieniu programu dodac nowy przycisk:
- Utworzylem proste okno w NetBeans JFrame.
- Na nim ulozylem jeden JPanel i jeden JButton.
- Po kliknieciu JButton wykonywany jest kod:
javax.swing.JButton button = new javax.swing.JButton("test");
jPanel1.add(button);
jPanel1.repaint();
i nic sie nie dzieje. Probowalem juz chyba wszystkiego i nie wiem czy
to nie jest jakis kruczek w kodzie generowanym przez NetBeans'a czy
cos z layoutami.
Jakies sugestie?
Pozdr.
Shuwar
Technical Details
Message-ID:
<88c53778-f558-4ffa-a8f9-028a81564fb0@a12g2000vbz.googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!feeder.news-service.com!postnews.google.com!a12g2000vbz.googlegroups.com!not-for-mailShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!feeder.news-service.com!postnews.google.com!a12g2000vbz.googlegroups.com!not-for-mail From: Shuwar <info@softwareprojekt.com.pl> Newsgroups: pl.comp.lang.java Subject: NetBeans i dynamiczne dodanie JButton do JPanel / JFrame Date: Sat, 15 Oct 2011 11:04:04 -0700 (PDT) Organization: http://groups.google.com Lines: 18 Message-ID: <88c53778-f558-4ffa-a8f9-028a81564fb0@a12g2000vbz.googlegroups.com> NNTP-Posting-Host: 89.228.241.93 Mime-Version: 1.0 X-Trace: posting.google.com 1318701845 17109 127.0.0.1 (15 Oct 2011 18:04:05 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 15 Oct 2011 18:04:05 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a12g2000vbz.googlegroups.com; posting-host=89.228.241.93; posting-account=B0AC2QoAAAD5fLpxaRhUE9fT_tEvcKyn User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1,gzip(gfe) Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit