How do I run an applet within an applet?

I'm trying to write a math applet that will also run a tic tac toe applet. if the student gets a correct answer, they get a turn, but if the answer is wrong, the computer takes a turn. kind of like hollywood squares, but with math.
Thanks for any help that I might receive!

separate the model from the view, then one applet can use both models and the views are just panels that one applet calls. (also, an applet with a main becomes an application and it too just re-uses the same panels and model beans) alternately, you could serve up another page that has the 'prize' page.
I'm trying to write a math applet that will also run a
tic tac toe applet. if the student gets a correct
answer, they get a turn, but if the answer is wrong,
the computer takes a turn. kind of like hollywood
squares, but with math.
Thanks for any help that I might receive!

Similar Messages

  • Possible to have an applet within an applet?

    Hi. I am designing a GUI using swing. It has a Card layout ie. different tab screens. On one of them I want to implement a pannel within which the user can scribble.
    I have the code for a scribble applet. can I run that applet within a pannel in my GUI?
    how?
    or if not, how can place the scribble code in my GUI code to work only in that pannel on one of the tab screens?
    Yhis has me rightly puzzled, and I am sure there is a simple answer. I would appreciate any help on this matter,
    Thanks...

    I haven't tried this but it seems like it ought to work:
    Since Applet extends Panel, just add an instance of the Applet to your display as you would any other panel, then call its init() and start() methods.

  • How can I run jasperreports-0.6.8-applet.jar?

    Hi all,
    I'm trying to run the jasper's jar files.
    Do I need to run it to have a graphical interface ?

    Have you figured this out yet? I need the same question answered.

  • Load applet within another applet?

    Let's say I have two applets, A1, and A2. I'd like to load A1 on my HTML page, and I'd like A1 to load A2 within itself (i.e. not load it as another separate applet on the HTML page).
    Basically, A2 takes some parameters I would like to pass to it through A1, so I'd like to know if this is possible.
    Thanks for any help!
    James

    Totally possible. You just have to provide it an applet context
    see http://java.sun.com/j2se/1.4.2/docs/api/java/applet/AppletContext.html

  • How to run applet within packages in tomcat

    I have servlet packages and applet packages in my application. I can successfully called my servlet packages by using:
    http://localhost/servlet/mypackage1.mypackage2.myServlet
    However, I can't call my applet packages by using:
    http://localhost/myapplet.html
    <Applet
    CODE = "myApplet.class"
    BASECODE = "mypackage1.mypackage2/"
    </Applet>
    I am currently using tomcat default web services directory structure as follows:
    webapps\ROOT\WEB-INF\classes\mypackage1\mypackage2\myServlet.class
    webapps\ROOT\mypackage1\mypackage2\myApplet.class
    I received the following error:
    noClassDefFoundError:myApplet (wrongname: mypackage1\mypackage2\myApplet)
    Thanks in advance for any helps.

    This doesn't have anything do with servlets. Your
    problem, as you said, is how to write the HTML to run
    an applet. Whatever is trying to load that HTML
    doesn't know anything about your servlets and doesn't
    care. I think it is complaining because you did or
    didn't put your applet in the (badly-named) package
    mypackage1.mypackage2.The package names I used was just an example. My real package names were really long and 10 levels deep so I didn't want to use it. I finally figured out how to tell the browser to find my applet class package. Using my original example (with the bad package names):
    <Applet
    CODE = "mypackage1.mypackage2/myApplet.class"
    </Applet>
    I removed the codebase and just put the package class file in the root directory.
    I am sure there are more than one way to make this thing work but this is how I got my to work. Thanks.

  • How do I run applets in general?

    Do we need environment variables/classpath? If so, I'm not exactly sure what those are. All I know is how to mechanically set up the classpath directory in Windows XP. To make matters worse, I use Linux at home so I don't even know how to do that at all in the first place on my home machines. If I recall correctly, textpad and eclipse both run my applets but I don't know how to do it with netbeans or the command line.
    What I tried to do was to make an web.html file that has <APPLET CODE="TheClass.class"</APPLET> then I went to the directory with a terminal and did appletviewer web.html and it popped up my applet but it said start: applet was not initialized.
    I'm at school now so I'm on a Windows XP computer as I type this and I tried to do it here and I got this error message:
    E:\TempNetbeansProject\TempNetbeansProject\src>appletviewer inClass1.html
    Warning: Can't read AppletViewer properties file: C:\Documents and Settings\LAB2
    \.hotjava\properties Using defaults.
    load: class AppletPassParam.class not found.
    java.lang.ClassNotFoundException: AppletPassParam.class
            at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:210)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
            at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:143)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
            at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:690)
            at sun.applet.AppletPanel.createApplet(AppletPanel.java:785)
            at sun.applet.AppletPanel.runLoader(AppletPanel.java:714)
            at sun.applet.AppletPanel.run(AppletPanel.java:368)
            at java.lang.Thread.run(Thread.java:619)It would be GREATLY appreciated if someone could help me out with the basics!
    Thanks in advance!

    <APPLET CODE="TheClass.class"</APPLET>Is not valid HTML. It is not even well formed HTML. It should be more along the lines of..
    <APPLET CODE="TheClass.class"></APPLET>As already mentioned the class attribute does not need a suffix so..
    <APPLET CODE="TheClass"></APPLET>But that element is missing a width or height..
    <APPLET CODE="TheClass"
      width="600"
      height="400">
    </APPLET>----------------
    Two notes:
    - As far as input documents for Java based apps. - GI/GO. Do not expect correct output with invalid or malformed inputs.
    - Applets are an advanced area of programming. They are best avoided by newbies.

  • Why does running an applet within a portlet not work?

    Hello,
    I have an applet and I want to run this in a portlet.
    I tried to load this applet into a portlet with SunONE Studio and Portlet Builder, and it works. The applet is running without problems.
    Now I tried to run this applet in a portlet under WebLogic 8.1 SP3. But the applet doesn't load. There ist only a gray rectangle to see. No error message, which would help to find the problem.
    To load the applet I'm using the Applet tag as follows:
    <APPLET archive='"+request.getContextPath()+"/folder/myApplet.jar' code='source/applet/myapp.class' ></APPLET>
    It's the same, I am using with SunOne Studio and there is the same package/directory structure in both.
    Any ideas?
    Is ist possible to run applets within portlets under WL 8.1?
    Thank you!
    Ines

    Hello,
    I have an applet and I want to run this in a portlet.
    I tried to load this applet into a portlet with SunONE Studio and Portlet Builder, and it works. The applet is running without problems.
    Now I tried to run this applet in a portlet under WebLogic 8.1 SP3. But the applet doesn't load. There ist only a gray rectangle to see. No error message, which would help to find the problem.
    To load the applet I'm using the Applet tag as follows:
    <APPLET archive='"+request.getContextPath()+"/folder/myApplet.jar' code='source/applet/myapp.class' ></APPLET>
    It's the same, I am using with SunOne Studio and there is the same package/directory structure in both.
    Any ideas?
    Is ist possible to run applets within portlets under WL 8.1?
    Thank you!
    Ines

  • How can i run applets in kawa?

    how can i run compiled applet programs in KAWA
    help me

    If you always have the external display connected, you can configure the OS to consider it as the default or main display. Once everything is connected and set to your liking (resolution, color depth, etc.), "bless" the external display by clicking & dragging the menubar from the Mac's internal display onto the external. This only works if you are not using video mirroring.
    Once this is done, applications will open by default on the external and now "main" display and you can configure them to go fullscreen or whatever.

  • Help, how can i run JavaFX as Applet in browse

    can someone please tell me, how can i run JavaFX as Applet in browse
    thanks

    http://jfx.wikia.com/wiki/FAQ#What_is_needed_on_a_machine_to_run_JavaFX_applications.3F

  • How to load an Applet on a panel, within another Applet

    Hi,
    I want to know if and how it is possible to load an applet/application on a Panel within another Applet/Apllication.
    Who can help me?
    tnx

    You want to use an applet inside an other applet?
    Applet extends Panel
    you can take the source of the second applet, and instead of extending Applet extends Panel, and call the init method from the first applet.
    Hope this help

  • How can I run an applet from an application (frame)?

    I have an application (frame) that render images and save it, and then I want to create an animation with those images using Animator applet from the application itself, but I do not how to call the applet from the application, is this possible?
    Thanks in advance, Jorge

    You can simply run a JApplet in a JFrame. Just create a frame object, an object of your applet, add the applet to the frame and call the init() function of your applet. It could look like this:
    JFrame anyFrame = new JFrame("MyTitle");
    YourApplet yourApplet = new YourApplet();
    anyFrame.getContentPane().add(yourApplet, BorderLayout.CENTER);
    yourApplet.init();
    anyFrame.setSize(new Dimension(800,600));
    anyFrame.setVisible(true);
    You will not necessarily have to write the applets default constructor.

  • How can i run an applet from a webpage????

    can someone PLEASE tell me how i can run an applet from my webpage. a detailed response would be extremely appreciated.
    sam

    Here's a web page that you can use as skeleton. You should be able to start with that.
    <HTML>
    <HEAD>
    <TITLE>Title</TITLE>
    </HEAD>
    <BODY>
    <APPLET CODE="your.class" WIDTH=400 HEIGHT=300 IGNORE=""></APPLET>
    </BODY>
    </HTML>

  • How to run the program in the applet

    I have installed the JDK 1.3 and succesfully compiled my first Java application (appropriately named HelloWorld.java). I could compile the source file also.But i am getting an error when i am trying to run the program in the applet iam getting an error as
    "start applet not initialised"
    and the program is
    * The HelloWorldApp class implements an application that
    * displays "Hello World!" to the standard output.
    public class HelloWorldApp {
    public static void main(String[] args) {
    // Display "Hello World!"
    System.out.println("Hello World!");
    so please help me out
    Thanks in advance

    Hmm... this is a console based application...
    So it won't work using an applet viewer.
    You can try coding an applet instead.
    I hope I didn't misunderstand your question.

  • How does one execute unix commands from within an applet?

    Greetings Folks,
    I've written a simple java applet that runs a unix command and then displays some information. The applet compiles fine, and runs perfectly from the command line on my unix system.
    However, when I point a browser at the applet from my desktop PC I get the following error as taken from the java console:
    Exception in thread "AWT-EventQueue-2" java.security.AccessControlException: access denied (java.io.FilePermission <<ALL FILES>> execute)
    This is of course the first line in a long line of error messages. It appears that I am not able to execute a command on the unix system through my applet. I know the problem is with trying to execute a unix command since commenting it causes no error in the web browser. This is the command I'm using in java to execute the unix command:
    p = Runtime.getRuntime().exec("ps");
    Here's the html file on the unix system:
    <html>
    <head></head>
    <body>
    <appletcode=G.class height="250" width="400">
    Your browser does not support the applet tag.
    </applet>
    </body>
    </html>
    I won't list the java code since it is compiling and working on the command line. But, if you want to see it I'll provide it.
    I've done quite a bit of research on this and it seems that a great number of people have similar problems reading or executing files through java. I have yet to find a solution to this problem.
    Here are some details about my setup:
    Server:
    HP9000 running HP/UX 11.23
    Apache Web Server 2.0.35
    Java 1.5
    Desktop PC:
    Win2K Pro
    Internet Explorer 6
    Java 1.6
    If you have a solution I would be very grateful! This problem is keeping me from writing my application!
    thanks!
    kev

    Multi-posted.
    Already answered here http://forum.java.sun.com/thread.jspa?threadID=5225314&messageID=9916327#9916327
    Please don't multipost again!

  • Is it possible for an applet within a jsp to access a server session?

    I was trying to find info (and sample code) where an applet that is embedded and running within a JSP page accesses the same session of the jsp page it is in.
    The need is for the the applet to access a string within the session and capture it's value and then perform some actions with the string client side within the applet. The value of the string is not important for the example, just being able to access it is.
    Also can javascript cause the applet to call the server on say an "onclick" event? If so, how is this done?
    In otherwords, can javascript interact with an applet?

    Check out the documentation on Heterogeneous Connectivity.
    Hope this helps!

Maybe you are looking for