Google

Interview Questions Test your java skills Java API Reference Notifications Java Forums Newsletter Tell a Friend
Link to us Donate
Javagalaxy.com WWW
Subscribe Un Subscribe

Java Interview Questions on your mobileNew            

Java Interview Questions - JavaGalaxy.com

Your Ad Here

  Java Interview Questions                       Is your Interview Question not answered here? Send it to webmaster@javagalaxy.com, we will answer it.

    Search Interview Questions 

  Displaying     Interview Questions and answers.

  Please click here to give us Feedback / Suggestions on how we can improve Java interview questions and answers

 
 Question   Question by Abhishek Biswas:
How do you play audio clips without using applet class?  (Applets)  Discuss in Detail (QID: 672)
 Answer  Click on Discuss in Detail link for more details   You can do this using Java Media Framework. I dont have much context on this API.

 Question   If you need to display a String on the applet, what would you do?  (Applets)  Discuss in Detail (QID: 641)
 Answer    drawString() is used to output a String to an applet. This method is included in the paint() of the Applet

 Question   What are the methods to retrive information about an applet?  (Applets)  Discuss in Detail (QID: 640)
 Answer  Click on Discuss in Detail link for more details   getAppletInfo() : Returns a string describing the applet, its author, copyright information, etc.
getParameterInfo( ) method: Returns an array of string describing the applet?s parameters

 Question   What tags are mandatory when creating HTML to display an applet?  (Applets)  Discuss in Detail (QID: 639)
 Answer  Click on Discuss in Detail link for more details   code, height, width

 Question   What is AppletStub Interface?  (Applets)  Discuss in Detail (QID: 638)
 Answer  Click on Discuss in Detail link for more details   The applet stub interface provides the means by which an applet and the browser communicate. Your code will not typically implement this interface


 Question   Which classes and interfaces does Applet class consist?  (Applets)  Discuss in Detail (QID: 637)
 Answer  Click on Discuss in Detail link for more details   Applet class consists of a single class, the Applet class and three interfaces: AppletContext, AppletStub, and AudioClip

 Question   How do I determine the width and height of my application?  (Applets)  Discuss in Detail (QID: 636)
 Answer    Use the getSize() method, which the Applet class inherits from the Component class in the Java.awt package. The getSize() method returns the size of
the applet as a Dimension object, from which you extract separate width, height fields. The following code snippet explains this:

Dimension dim = getSize();
int appletwidth = dim.width();
int appletheight = dim.height();

 Question   How do I go from my applet to another JSP or HTML page?  (Applets)  Discuss in Detail (QID: 635)
 Answer    Use AppletContext and invoke showDocument() on that context object. Below is sample code

URL targetURL;
String URLString = "http://localhost:8080/mypage.jsp";
AppletContext context = getAppletContext();
try
{
       targetURL = new URL(URLString);
}
catch (MalformedURLException e)
{
       e.printStackTrace();
}
context.showDocument(targetURL);

 Question   How can I arrange for different applets on a web page to communicate with each other?  (Applets)  Discuss in Detail (QID: 634)
 Answer  Click on Discuss in Detail link for more details   Name your applets inside the Applet tag and invoke AppletContext?s getApplet() method in your applet code to obtain references to the other applets
on the page

 Question   When an user wants to send an int from HTML what does he needs to do?  (Applets)  Discuss in Detail (QID: 633)
 Answer    Either the user wants to send an int or a String, it will be the same. Here are steps he might do to get an int

[html]
[applet code="Launch.class" archive="bak.jar" width=740 height=460]
[param name="mynum" value="098765"]
[/applet]
[/html]

And within the init() of your applet, Use the following line to get the value.

String mynum = getParameter("mynum");
int x = Integer.parseInt(mynum);

 
Showing 1 - 10 of 892 Records Next Last    Jump to page number       Current page number: 1

   - Discussions are available

Copyright © 2002 - 2007 JavaGalaxy.com,
All Rights Reserved Advertise| Feedback| Contact us| Terms of Use| Privacy Policy|

Help us to keep serving you better. Donate $1 to keep this website free

If you find any part of this site useful please support the site by linking to us