Results 1 to 5 of 5

Thread: Swings

  1. #1
    bsantosh is offline Member
    Join Date
    Aug 2009
    Posts
    3
    Rep Power
    0

    Default Swings

    I had executed a simple prog Iam getting this error
    ""exception in thread main java.lang.noclassdeffounderror""

    Can U give Me Solution for this.....

  2. #2
    bsantosh is offline Member
    Join Date
    Aug 2009
    Posts
    3
    Rep Power
    0

    Default

    I had executed a simple prog Iam getting this error
    ""exception in thread main java.lang.noclassdeffounderror""

    Can U give Me Solution for this.....

  3. #3
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    835
    Rep Power
    6

    Default

    Hi,

    Whether ur file got compiled? Are u able to see your class file.
    Ur path is correct?

    Gothru this article for guidance.
    JavaWorld Forums: Exception in thread "main" java.lang.NoClassDef...
    Ramya:cool:

  4. #4
    bsantosh is offline Member
    Join Date
    Aug 2009
    Posts
    3
    Rep Power
    0

    Default Awt Prog is Not executing..Plse .Check this

    Java Code:
    import java.awt.*;
    import java.applet.*;
    import java.io.*;
     public class MenuDemo  {
    	  public static voidmain(String args[]) 
    	{
    		MenuBar mb =new MenuBar();
    		Menu f1=new Menu("file");
    		f1.add(new MenuItem("new"));
    		f1.add(new MenuItem("open"));
    		f1.addSeparator();
    		f1.add(new MenuItem("save"));
    		f1.add(new MenuItem("save as"));
    		f1.addSeparator();
    		f1.add(new MenuItem("close"));
    		mb.add(f1);
    		Frame f=new Frame("Menus Demo");
    		f.setSize(300,300);
    		f.pack();
    		f.setVisible(true);
    	 }
    	}
    Last edited by Fubarable; 08-31-2009 at 02:09 PM. Reason: code tags added for readability

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Your void and your main words are concatenated together. Is this a typographical error or is this how your program truly looks? In other words, this:
    Java Code:
    public static voidmain(String args[])
    should look like this:
    Java Code:
    public static void main(String args[]) // note gap between void and main
    Also, you really should be learning Swing, not AWT.
    Last edited by Fubarable; 08-31-2009 at 02:13 PM.

Similar Threads

  1. JAVA-Swings
    By HariPrasad in forum AWT / Swing
    Replies: 6
    Last Post: 12-29-2010, 02:29 AM
  2. jdbc with swings
    By raghu9198 in forum New To Java
    Replies: 3
    Last Post: 06-24-2009, 10:42 PM
  3. interface in swings
    By r.srimathi in forum AWT / Swing
    Replies: 4
    Last Post: 01-29-2009, 08:44 AM
  4. awt and swings
    By masa in forum AWT / Swing
    Replies: 2
    Last Post: 11-24-2008, 07:09 AM
  5. java swings
    By emperoraj in forum AWT / Swing
    Replies: 0
    Last Post: 03-26-2008, 11:50 AM

Posting Permissions

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