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 9221975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:42:18+00:00 2026-06-18T03:42:18+00:00

I have an applet which has 2 methods that I want to use. On

  • 0

I have an applet which has 2 methods that I want to use. On the first method, I am getting client printer list.

I want to use this printer list on my HTML page in a combo. The user is expected to choose a printer from this combo. After that, the user will click a button to do some operations. After clicking that button and finishing those operations, I want to call
the second method of my applet, which gets two parameters, one is a file object, other is a printer object that user already selected.

My questions are:

How can I get printer list and use it on my HTML page after page loads?
How can I send parameters to second method of my applet after clicking the button?

  • 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-18T03:42:20+00:00Added an answer on June 18, 2026 at 3:42 am
    To have my applet work;
    1- I exported the applet as jar file(named as printApplet.jar) and copied it under the same folder as my xhtml page.
    2- I put the applet in xhtml as below;
             <applet id="myApplet"
                code="com.xxx.yyy.console.action.PrintApplet"
                archive="printApplet.jar" width="1" height="1">         
            </applet>
    3- I created a method `enter code here`in the applet which gets printer names as string and has comma(,) between the names. 
    4- I called the applet methods using javascript as below;
    <script type="text/javascript" >
        //<![CDATA[
        function getPrinters() {
            var aplt = document.getElementById("myApplet");     
            var printers = aplt.getPrinterNames();
            var p = printers.split(',');
            var c = document.getElementById("combo");
            for ( var i = 0; i < p.length; i++) {
                var o = document.createElement("option");
                o.text = p[i];
                o.value = i;
                try {
                    c.add(o, null); //Standard 
                } catch (error) {
                    c.add(o); // IE only
                }
            }
        }   
        //]]>
    </script> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an applet which runs in a browser. I expect that when the
I have an online service which uses a java applet to perform client side
I have a client application which runs as a Java applet from a user's
I have an applet, which I was writing in Java. Recently, I thought that
I have an applet which runs in a browser and is called from Javascript.
I have written a java applet which opens a JFrame (so when run in
I have a POS web application which currently executes a java applet on page
I have a PHP array which looks like this example: $array[0][0] = 'apples'; $array[0][1]
I have read from some article that say's Apple doesn't approve the application which
I haven't found a comprehensive list of the steps that are required to use

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.