Thread: Run Client -> Exception in thread "main" java.lang.NoClassDefFoundError: Jframe

Results 1 to 7 of 7
  1. #1 Run Client -> Exception in thread "main" java.lang.NoClassDefFoundError: Jframe 
    Banned

    Join Date
    Jul 2011
    Age
    27
    Posts
    748
    Thanks given
    2,207
    Thanks received
    451
    Rep Power
    0
    I am running Galkons client that I have put countless hours into developing just to be punched in the face by this error

    Code:
    Running AmbientScape Client.
    Please wait patiently...
    Exception in thread "main" java.lang.NoClassDefFoundError: Jframe
    Caused by: java.lang.ClassNotFoundException: Jframe
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
    Could not find the main class: Jframe.  Program will exit.
    Press any key to continue . . .
    I'll rep anyone who has an Idea and fix to this issue, cheesrsss
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Sep 2011
    Posts
    1,140
    Thanks given
    385
    Thanks received
    398
    Rep Power
    474
    Do you have class Jframe?
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Jul 2011
    Age
    27
    Posts
    748
    Thanks given
    2,207
    Thanks received
    451
    Rep Power
    0
    No I don't, but I ripped one out of the origional Galkons client and I get this error

    Code:
    Compiling AmbientScape Client.
    Please wait patiently...
    Jframe.java:15: cannot inherit from final client
    public class Jframe extends client implements ActionListener {
                                ^
    Jframe.java:21: client() has private access in client
                    super();
                    ^
    Note: client.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    2 errors
    Press any key to continue . . .
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Sep 2011
    Posts
    1,140
    Thanks given
    385
    Thanks received
    398
    Rep Power
    474
    remove the final in final class ActionListener, and change private client() to public client()
    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Jul 2011
    Age
    27
    Posts
    748
    Thanks given
    2,207
    Thanks received
    451
    Rep Power
    0
    I havnt got any of those dude

    here's my Jframe class

    Code:
    
    import sign.signlink;
    import java.net.*;
    import java.awt.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import javax.swing.*;
    import javax.swing.plaf.metal.MetalLookAndFeel;
    
    
    // CLIENT
    // AmbientScape - Jframe.java
    
    
    public class Jframe extends client implements ActionListener {
    
        private static JMenuItem menuItem;
    	private JFrame frame;
    
    	public Jframe(String args[]) {
    		super();
    		try {
    			sign.signlink.startpriv(InetAddress.getByName(server));
    			initUI();
    		} catch (Exception ex) {
    			ex.printStackTrace();
    		}
    	}
    
    	public void initUI() {
    		try {
    			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    			JPopupMenu.setDefaultLightWeightPopupEnabled(false);
    			frame = new JFrame("AmbientScape - Official Client");
    			frame.setLayout(new BorderLayout());
    			frame.setResizable(false);
    			frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    			JPanel gamePanel = new JPanel();
    
    			gamePanel.setLayout(new BorderLayout());
    			gamePanel.add(this);
    			gamePanel.setPreferredSize(new Dimension(765, 503));
    
    			JMenu fileMenu = new JMenu("File");
    
    			String[] mainButtons = new String[] { "AmbientScape", "-", "Exit" };
    
    			for (String name : mainButtons) {
    				JMenuItem menuItem = new JMenuItem(name);
    				if (name.equalsIgnoreCase("-")) {
    					fileMenu.addSeparator();
    				} else {
    					menuItem.addActionListener(this);
    					fileMenu.add(menuItem);
    				}
    			}
    
    			JMenuBar menuBar = new JMenuBar();
    			JMenuBar jmenubar = new JMenuBar();
    
    			frame.add(jmenubar);
    			menuBar.add(fileMenu);
    			frame.getContentPane().add(menuBar, BorderLayout.NORTH);
    			frame.getContentPane().add(gamePanel, BorderLayout.CENTER);
    			frame.pack();
    
    			frame.setVisible(true); // can see the client
    			frame.setResizable(false); // resizeable frame
    
    			init();
    		} catch (Exception e) {
    				e.printStackTrace();
    		}
    	}
    
    	public URL getCodeBase() {
    		try {
    			return new URL("http://" + server + "/cache");
    		} catch (Exception e) {
    			return super.getCodeBase();
    		}
    	}
    
    	public URL getDocumentBase() {
    		return getCodeBase();
    	}
    
    	public void loadError(String s) {
    		System.out.println("loadError: " + s);
    	}
    
    	public String getParameter(String key) {
    			return "";
    	}
    
    	private static void openUpWebSite(String url) {
    		Desktop d = Desktop.getDesktop();
    		try {
    			d.browse(new URI(url)); 	
    		} catch (Exception e) {
    		}
    	}
    
    	public void actionPerformed(ActionEvent evt) {
    		String cmd = evt.getActionCommand();
    		try {
    			if (cmd != null) {
    				if (cmd.equalsIgnoreCase("exit")) {
    					System.exit(0);
    				}
    				if (cmd.equalsIgnoreCase("AmbientScape")) {
    					openUpWebSite("http://www.wix.com/pigeater6/ambientx#!");
    				}	
    			}
    		} catch (Exception e) {
    		}
    	}
    
    }
    Reply With Quote  
     

  6. #6  
    Banned

    Join Date
    Jul 2011
    Age
    27
    Posts
    748
    Thanks given
    2,207
    Thanks received
    451
    Rep Power
    0
    BUMP before I go to bed
    Reply With Quote  
     

  7. #7  
    Registered Member
    Kamiel's Avatar
    Join Date
    Jul 2010
    Age
    25
    Posts
    1,272
    Thanks given
    66
    Thanks received
    166
    Rep Power
    295
    search for client(), and add public in front of it.
    If you need any help, I've done alot with JFrames/GUI, can always contact me
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 14
    Last Post: 09-02-2015, 12:13 PM
  2. Replies: 1
    Last Post: 03-07-2012, 01:41 AM
  3. Replies: 10
    Last Post: 11-17-2010, 05:19 PM
  4. Replies: 3
    Last Post: 08-22-2010, 08:29 PM
  5. Replies: 14
    Last Post: 06-30-2010, 05:59 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
  •