Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: JFrame issues Date: Mon, 03 Dec 2012 08:34:43 -0500 Organization: A noiseless patient Spider Lines: 42 Message-ID: References: <511a3304-a598-413b-a630-b2e1454fd11c@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 3 Dec 2012 13:34:49 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="ffb8f7085759b339c1002252b48331a4"; logging-data="19949"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/1rxBbDiyAyf/6Xt2WMqot" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: <511a3304-a598-413b-a630-b2e1454fd11c@googlegroups.com> Cancel-Lock: sha1:psLsjXiuwZiio+hzdDqtRYvPhwY= Xref: csiph.com comp.lang.java.programmer:20064 On 12/2/2012 11:34 PM, K wrote: > Here is my script does anyone know why this isn't working > > import javax.swing.JFrame; > import javax.swing.ImageIcon; > import javax.swing.JLabel; > import javax.swing.Continer; Because there's no Continer class in javax.swing. > class Jframe { > > public static void main(String[] args) { > JFrame frame = new JFrame(); Because Swing components should be constructed and manipulated on the Event Dispatch Thread. > ImageIcon icon = new ImageIcon(puffin.jpg); Because puffin.jpg is a syntax error. > JLabel label = new JLable (icon); Because no JLable class has been declared. > Container contentPane = frame.getContentPane(); Because no Container class has been declared. > contentPane.add(label); > frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); > frame.pack(); > frame.setVisible(true); > > } > > } -- Eric Sosman esosman@comcast-dot-net.invalid