Thread: C# | Is it possible to add a applet to a form?

Results 1 to 2 of 2
  1. #1 C# | Is it possible to add a applet to a form? 
    Registered Member
    Join Date
    Apr 2018
    Posts
    13
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    So I am working with a project that involves [Only registered and activated users can see links. ]

    Now it works great and everything until I realized I can't design and cuztomize the JFrame. So what I wanted to do was to, instead of adding the applet to a JFrame, add it to a Windows Form. I am not sure if this [Only registered and activated users can see links. ] allows that

    Because with Java you would just do this
    Code:
    JFrame frame = new JFrame("OSLoader");
    frame.setSize(763, 514);
    frame.setPreferredSize(new Dimension (763, 514));
    frame.pack();
    frame.setVisible(true);
    Applet applet = (Applet)classLoader.loadClass("client").newInstance();
    frame.add(applet);
    The magic line being
    Code:
    frame.add(applet);

    How do I add the applet to a Windows form? Maybe inside a panel or something. The jar file I am using (if it's even needed for this) is this one, a [Only registered and activated users can see links. ]

    Current code
    Code:
    private void BtnRun_Click(object sender, EventArgs e)
            {
                //Create an applet
                //Instead of adding that applet to a JForm, add it to a panel or a WinForms Form
    
                JFrame frame = new JFrame("OSLoader");
    
                Form aForm = new Form();
                aForm.Width = 514;
                aForm.Height = 763;
                aForm.Visible = true;
    
                frame.setSize(763, 514);
                frame.setPreferredSize(new Dimension (763, 514));
                frame.pack();
                frame.setVisible(true);
                URLClassLoader classLoader = new URLClassLoader(new URL[] {
                    new URL("file:gamepack.jar")});
    
                Applet applet = (Applet)classLoader.loadClass("client").newInstance();
    
                //applet.setStub(stub);
                applet.setSize(new Dimension(763, 514));
                //applet.init();
                applet.start();
                frame.add(applet);
                frame.pack();
                frame.setDefaultCloseOperation(3);
            }
    Reply With Quote  
     

  2. #2  
    Donator

    funkE's Avatar
    Join Date
    Feb 2008
    Posts
    2,586
    Thanks given
    232
    Thanks received
    957
    Rep Power
    1236
    There used to be a Runescape bot that did this very thing. It was written in C#

    What they did was make images rendered by the Java client available for the C# client, then input from the C# client available to the Java client.

    IKVM is being discontinued, so might want to assess why you want to do something ridiculous like writing a C# app to work with a RuneScape client.
    .
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 02-22-2018, 09:16 PM
  2. Replies: 3
    Last Post: 06-27-2012, 10:24 PM
  3. Replies: 10
    Last Post: 07-23-2011, 10:52 AM
  4. Replies: 5
    Last Post: 02-08-2009, 10:46 AM
  5. Replies: 7
    Last Post: 02-04-2009, 08:19 PM
Tags for this Thread

View Tag Cloud

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