Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.glorb.com!news-out.readnews.com!transit3.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!53ab2750!not-for-mail From: "markspace" Subject: Re: jLabel setVisible(true) Doesn't Work Message-ID: <5022AB7A.56318.calajapr@time.synchro.net> X-Comment-To: clusardi2k Newsgroups: comp.lang.java.programmer In-Reply-To: <5022AB7A.56317.calajapr@time.synchro.net> References: <5022AB7A.56317.calajapr@time.synchro.net> X-FTN-AREA: COMP.LANG.JAVA.PROGRAMMER X-FTN-MSGID: 1:261/38 2475d7c0 X-FTN-REPLY: 1:261/38 91887e30 Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: time.synchro.net [Synchronet 3.16a-Win32 NewsLink 1.98] Lines: 30 Date: Wed, 08 Aug 2012 19:04:13 GMT NNTP-Posting-Host: 69.21.70.65 X-Complaints-To: news@tds.net X-Trace: newsreading01.news.tds.net 1344452653 69.21.70.65 (Wed, 08 Aug 2012 14:04:13 CDT) NNTP-Posting-Date: Wed, 08 Aug 2012 14:04:13 CDT Organization: tds.net Xref: csiph.com comp.lang.java.programmer:17368 To: clusardi2k From: markspace <-@.> On 8/7/2012 12:15 PM, clusardi2k@aol.com wrote: > SwingUtilities.invokeLater(new Runnable() > { //The EDT (Event Dispatch Thread) > public void run() > { > JLabel myLabel = new JLabel("Old Text"); > my_jLabel.setVisible (true); The second to the last line is the problem. Your label has to be inside another component (a container) to be visible. Changing a local variable will never work. Even changing an instance field won't work unless you've specially defined your own component somehow. Most Swing components are also containers. However normally you use JFrame and JPanel as your containers. Call the add method, or use the GUI layout tool to just drag and drop components onto one. This might help: --- BBBS/Li6 v4.10 Dada-1 * Origin: Prism bbs (1:261/38) --- Synchronet 3.16a-Win32 NewsLink 1.98 Time Warp of the Future BBS - telnet://time.synchro.net:24