Results 1 to 2 of 2
  1. #1
    Bibin is offline Member
    Join Date
    Dec 2011
    Posts
    5
    Rep Power
    0

    Post i get this error during compile

    cannot resolve symbol
    symbol:class windowAdapter
    location:class mydlg
    addWindowListener(new windowAdapter()

    (same error in line 11 and 46)
    This is my code

    Java Code:
    import java.awt.*;
    import java.awt.event.*;
    public class dlgexp extends Frame implements ActionListener
    {
    	Button b1;
    	public dlgexp()
    	{
    	setLayout(new FlowLayout());
    	b1=new Button("Click");
    	add(b1);
    	addWindowListener(new windowAdapter()
    	{
    		public void windowClosing(WindowEvent we)
    		{
    			dispose();
    		}
    	});
    	b1.addActionListener(this);
    	}
    	public void actionPerformed(ActionEvent ae)
    	{
    	if(ae.getSource()==b1)
    	{
    		mydlg dd=new mydlg(this,"Subwindow",false);
    		dd.setSize(200,200);
    		dd.setVisible(true);
    	}
    	}
    	public static void main(String arg[])
    	{
    		dlgexp dd=new dlgexp();
    		dd.setSize(300,300);
    		dd.setVisible(true);
    	}
    }
    
    class mydlg extends Dialog
    {
    	TextField f1;
    	mydlg(Frame f,String t, boolean m)
    	{
    		super(f,t,m);
    		setLayout(new FlowLayout());
    		f1=new TextField(20);
    		add(f1);
    		addWindowListener(new windowAdapter()
    		{
    			public void windowClosing(WindowEvent we)
    			{
    				dispose();
    			}
    		});
    	}
    }
    Last edited by pbrockway2; 12-24-2011 at 08:49 AM. Reason: code tags added

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,361
    Blog Entries
    7
    Rep Power
    20

    Default Re: i get this error during compile

    The class name is 'WindowAdapter' (with a capital-W); Java is picky about the case of identifiers.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. compile error
    By missmara77 in forum New To Java
    Replies: 1
    Last Post: 10-31-2011, 07:48 PM
  2. Compile Error
    By gcorreageek in forum Advanced Java
    Replies: 2
    Last Post: 09-08-2010, 05:23 AM
  3. compile error
    By angryredantz in forum New To Java
    Replies: 1
    Last Post: 01-23-2009, 10:44 PM
  4. Compile Error - Please Help!!
    By AJ2009 in forum New To Java
    Replies: 10
    Last Post: 01-04-2009, 03:59 PM
  5. compile error
    By dirtycash in forum New To Java
    Replies: 6
    Last Post: 12-12-2007, 06:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •