Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9018511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:32:44+00:00 2026-06-16T04:32:44+00:00

I’m rewriting an applet I have, but when it loads it’s giving me a

  • 0

I’m rewriting an applet I have, but when it loads it’s giving me a runtime exception.
The exception is

Exception in thread "main" java.lang.NoSuchMethodError: ClientSettings: method <
init>()V not found
        at RunClient.<init>(RunClient.java:41)
        at RunClient.main(RunClient.java:63)

Here is RunClient:

import java.applet.Applet;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Desktop;
import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Properties;

import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JSeparator;


public class RunClient extends Applet implements ActionListener {

    private Robot robot;
    private static final long serialVersionUID = 1L;
    public static Properties params = new Properties();
    public JFrame mainFrame;
    public JPanel mainPane = new JPanel();
    public static String[] data;
    public String mainurl = getParameter("ip");
    public int lang = 0;
    public String frameName = getParameter("servername");
    public JPanel totalPanel;
    private JMenuBar menuBar = new JMenuBar();
    private int capNum;
    private FilenameFilter filter = new FilenameFilter() {

        @Override
        public boolean accept(File arg0, String arg1) {
            if (arg0.getName().equals("images") && arg1.endsWith("png")) {
                return true;
            }
            return false;
        }

    };
    public static final Object[][] JMENU_BUTTONS = new Object[][]{{"File", new JMenuItem("New Client"), new JSeparator(), new JMenuItem("Exit")}, {"Guides", new JMenuItem("Getting Started"), new JMenuItem("Fighting Monsters"), new JMenuItem("Money Making")}, {"Links", new JMenuItem("Wiki"), new JMenuItem("Forums"), new JMenuItem("Youtube"), new JMenuItem("Donate")}, {"Tools", new JMenuItem("Take a screenshot")}};
    public String[] getLoaderParameters() {
        return new String[]{getParameter("servername"), getParameter("ip"), getParameter("port")};
    }
    public static void main(String[] strings) {
        data = getLoaderParameters();
        new ClientSettings(data);
        RunClient runclient = new RunClient();
        runclient.doFrame();
    }

    public RunClient() {
        try {
            loadCaptureAmts();
            robot = new Robot();
        } catch(Exception e) {
            e.printStackTrace();
        }
    }

    private void loadCaptureAmts() {
        capNum = new File("./images/").listFiles(filter).length;
    }

    public void init() {
        doApplet();
    }

    void doApplet() {
        try {
            readVars();
            startClient();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    public void doFrame() {
        try {
            readVars();
            openFrame();
            startClient();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    public void readVars() throws IOException {
        params.put("cabbase", "g.cab");
        params.put("java_arguments", "-Xmx1024m -Dsun.java2d.noddraw=true");
        params.put("colourid", "0");
        params.put("worldid", "16");
        params.put("lobbyid", "15");
        params.put("demoid", "0");
        params.put("demoaddress", "");
        params.put("modewhere", "0");
        params.put("modewhat", "0");
        params.put("lang", "0");
        params.put("objecttag", "0");
        params.put("js", "1");
        params.put("game", "0");
        params.put("affid", "0");
        params.put("advert", "1");
        params.put("settings", "wwGlrZHF5gJcZl7tf7KSRh0MZLhiU0gI0xDX6DwZ-Qk");
        params.put("country", "0");
        params.put("haveie6", "0");
        params.put("havefirefox", "1");
        params.put("cookieprefix", "");
        params.put("cookiehost", "127.0.0.1");
        params.put("cachesubdirid", "0");
        params.put("crashurl", "");
        params.put("unsignedurl", "");
        params.put("sitesettings_member", "1");
        params.put("frombilling", "false");
        params.put("sskey", "");
        params.put("force64mb", "false");
        params.put("worldflags", "8");
        params.put("lobbyaddress", mainurl);
    }

    public void openFrame() {
        JPopupMenu.setDefaultLightWeightPopupEnabled(false);
        mainPane.setLayout(new BorderLayout());
        mainPane.add(this);
        mainPane.setPreferredSize(new Dimension(765, 503));
        totalPanel = new JPanel();
        totalPanel.setPreferredSize(new Dimension(765, 503));
        totalPanel.setLayout(new BorderLayout());
        totalPanel.add(mainPane, BorderLayout.CENTER);
        mainFrame = new JFrame(frameName);
        mainFrame.setLayout(new BorderLayout());
        mainFrame.getContentPane().add(totalPanel, BorderLayout.CENTER);
        mainFrame.setDefaultCloseOperation(3);
        //setMenuBar();
        mainFrame.pack();
        mainFrame.setVisible(true);
    }

    private void setMenuBar() {
        int id = 0;
        for (int y = 0; y < JMENU_BUTTONS.length; y++) {
            JMenu menu = new JMenu();
            for (int i = 0; i < JMENU_BUTTONS[y].length; i++) {
                if (i == 0) {
                    menu.setText((String) JMENU_BUTTONS[y][i]);
                } else if (JMENU_BUTTONS[y][i] instanceof JMenuItem){
                    JMenuItem item = (JMenuItem) JMENU_BUTTONS[y][i];
                    menu.add(item);
                    item.setActionCommand(""+ id++);
                    item.addActionListener(this);
                } else {
                    menu.add((JSeparator) JMENU_BUTTONS[y][i]);
                }
            }
            menuBar.add(menu);
        }
        mainFrame.setJMenuBar(menuBar);

    }

    public void startClient() {
        try {
            //RuntimeLoader loader = new RuntimeLoader();
            //Class clientclass = loader.loadClass("client");

            //Applet clientApplet = (Applet) clientclass.newInstance();
            //clientclass.getMethod("provideLoaderApplet",
            //      new Class[] { java.applet.Applet.class }).invoke(null,
            //              new Object[] { this });
            //clientApplet.init();
            //clientApplet.start();
            client.provideLoaderApplet(this);
            client var_client = new client();
            var_client.init();
            var_client.start();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }


    public URL getDocumentBase() {
        return getCodeBase();
    }

    public URL getCodeBase() {
        URL url;
        try {
            url = new URL(new StringBuilder().append("http://").append(mainurl)
                    .toString());
        } catch (Exception exception) {
            exception.printStackTrace();
            return null;
        }
        return url;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        switch (Integer.parseInt(e.getActionCommand())) {
        case 1:
            if (JOptionPane.showConfirmDialog(this, "Are you sure you want to quit?") == 0)
                System.exit(0);
            break;
        case 2:
            browse("http://dementhium.wikia.com/wiki/Getting_Started");
            break;
        case 3:
            browse("http://forums.dementhium.com/showthread.php?t=143");
            break;
        case 4:
            browse("http://dementhium.wikia.com/wiki/Dementhium_Wiki");
            break;
        case 5:
            browse("http://dementhium.wikia.com/wiki/Dementhium_Wiki");
            break;
        case 6:
            browse("http://forums.dementhium.com/");
            break;
        case 7:
            browse("http://www.youtube.com/DementhiumOfficial");
            break;
        case 8:
            browse("http://forums.dementhium.com/payments.php");
            break;
        case 9:
            writeImage(robot.createScreenCapture(getGameScreenRectangle()));
            break;
        default:
            System.out.println(Integer.parseInt(e.getActionCommand()));
        }

    }

    private Rectangle getGameScreenRectangle() {
        Rectangle rect = getBounds();
        rect.setLocation(this.getLocationOnScreen());
        return rect;
    }

    private void writeImage(BufferedImage createScreenCapture) {
        try {
            ImageIO.write(createScreenCapture, "PNG", new File("./images/capture-" + capNum++ + ".png"));
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

    private void browse(String string) {
        if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
            try {
                Desktop.getDesktop().browse(new URI(string));
            } catch (IOException e1) {
                e1.printStackTrace();
            } catch (URISyntaxException e1) {
                e1.printStackTrace();
            }
        }

    }

}

and here is ClientSettings.java, this is called from various files, args is always defined using

public String[] data;

in RunClient

public class ClientSettings {
    public int PORT;
    public String IPADDRESS;
    public String SERVERNAME;
    public ClientSettings(String[] args) {
        PORT = Integer.parseInt(args[2]);
        IPADDRESS = args[1];
        SERVERNAME = args[0];


    }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:32:45+00:00Added an answer on June 16, 2026 at 4:32 am

    Line 41 of RunClient is looking for a default constructor on ClientSettings, which doesn’t exist. You’ve defined a constructor that takes a String[], so no default constructor is generated. It looks like the code you’ve posted isn’t what’s running, because it seems to show a correct constructor call.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
This could be a duplicate question, but I have no idea what search terms
I have been unable to fix a problem with Java Unicode and encoding. The
I have thousands of HTML files to process using Groovy/Java and I need to
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.