Embed an applet into jpanel

I have a unique problem. I have an application built on swing f/w with xml used for design and maven used for build.
I have an applet that is independent of this application. Now i dont have a clue how to embed that applet into a jpanel or into that application. Anything of that will help me immensely. Please suggest if anybody has a clue.
Thanks in advance.
Regards,
Ashish

>
I have a unique problem. >Big claim since..
>
..I have an application built on swing f/w with xml used for design and maven used for build.
I have an applet that is independent of this application. Now i dont have a clue how to embed that applet into a jpanel or into that application. >..the AppletViewer has been Swing based since around 1.3 or before. ;-)
In any case, if you control the source of the applet, or can recreate it, the best solution has already been given on the first reply.
If not, and it actually makes sense to embed an Applet or JApplet in a Swing JPanel(/JFrame), then it becomes more complicated.
Here is one of the most simplistic [examples of embedding an applet in a JFrame|http://forums.sun.com/thread.jspa?messageID=10259860#10259860]. If it becomes necessary to pass parameters to the applet, allow it to share input streams, or implment the showStatus() showDocument() methods as I did in Appleteer, it becomes more complex again. So far I have found no practical way to mimic Applet/JavaScript interaction.
Edit 1:
And noting you are yet another multi-poster. No that is not unique, just very irritating, and a great disincentive for others to help.
Edited by: AndrewThompson64 on Jul 1, 2009 1:40 AM

Similar Messages

  • How to embed an Applet into html

    Hi, I've an applet called IDrive written in Eclispe which works perfect there, I've been trying to paste the IDrive class file into my html folder and embed my applet by trying e.g.
    <applet code="../css/IDrive.class" width="300" Height="400">
    </applet>css is a folder outside the folder which contains the html file in which im trying to embed my Applet
    but no matter what I do i keep getting class not found error's, and as im totally new to applets I hope someone could please help me....
    Thanks

    I suggest you look at the applets under the demo directory and how they are done.
    Here are also some tutorials.
    [http://www.google.co.uk/search?q=applet+html+tutorial]

  • How to embed an applet in a JPanel

    Hi All,
    I am in need of serious help as I have not been able to figure this out for days!!!
    All I want to do is to display a runnable applet in a JPanel.
    The applet is shown below. Its a ball bouncing around. All I need to do is to embed this in a Jpanel with buttons which will control the movement of the ball in the applet which should be on a Panel. For the life of me I havent figured it out!
    Can someone help a brother out!
    import java.awt.*;
    import javax.swing.*;
    import java.applet.Applet;
    import java.awt.*;
    import javax.swing.JOptionPane;
    import javax.swing.*;
    import java.awt.event.*;
    //Animation Class
    class Animation extends Thread {
    private Applet appl;
    private Color color;
    private int increment, vincrement;
    private int which;
    private int position = 0;
    private int vposition = 0;
    public int xCenter, yCenter;
    private int pause;
    private int width, height, speed;
    private double distance;
    private Dimension[] rotations;
    private int currentRotation ;
    Animation(Applet a, Color c, int p, int wid, int hei ,int theSpeed, int Start) {
    color = c;
    appl = a;
    pause = p;
    width = wid;
    height = hei;
    speed = theSpeed;
    rotations = new Dimension[8];
    rotations[0] = new Dimension(1,0);
    rotations[1] = new Dimension(1,-1);
    rotations[2] = new Dimension(0,-1);
    rotations[3] = new Dimension(-1 , -1);
    rotations[4] = new Dimension(-1,0);
    rotations[5] = new Dimension(-1,1);
    rotations[6] = new Dimension(1,0);
    rotations[7] = new Dimension(1,1);
    currentRotation = Start;
    increment = (int)rotations[Start].getWidth();
    vincrement = (int)rotations[Start].getHeight();
    setSpeed();
    public void setSpeed()
    {  increment = increment*speed;
    vincrement = vincrement * speed;
    public void changeRotation(int run, int rise){
    increment = run;
    vincrement = rise;
    setSpeed();
    public void rotate(){
    currentRotation++;
    if (currentRotation == 8)
    currentRotation = 0;
    changeRotation((int)rotations[currentRotation].getWidth(), (int)rotations[currentRotation].getHeight() );
    public void bounce(){
    increment = -increment;
    public void vBounce(){
    vincrement = -vincrement;
    public void setColor(Color n)
    color = n;
    public void run() {
    while (true) {
    try {
    Thread.sleep(pause);
    } catch (InterruptedException e) {}
    position += increment;
    if (position > width - 30 || position <= 0)
    { increment = -increment;
    vposition += vincrement;
    if (vposition > height - 30 || vposition <= 0)
    { vincrement= -vincrement;
    appl.repaint();
    public void draw(Graphics g) {
    g.setColor(color);
    g.fillOval(0 + position, 0 + vposition,30, 30);
    setCentre();
    public void setCentre(){
    xCenter = position - 30/2;
    yCenter = vposition -30/2;
    public boolean didCollide(Animation x){
    distance = Math.sqrt( Math.pow( (xCenter- x.xCenter) ,2) + Math.pow((yCenter-x.yCenter) , 2) );
    if (distance <= 31){
    return true;
    }else return false;
    }

    I took the liberty to make few changes:
    the applet:
    import java.awt.*;
    public class AnimA extends java.applet.Applet
         Animation anim;
         int p   = 70;
         int wid = 400;
         int hei = 300;
        int theSpeed = 2;
         int start    = 7;
    public void init()
         setLayout(new BorderLayout());
         anim = new Animation(Color.green,p,wid,hei,theSpeed,start);     
         add("Center",anim);
         Panel panel = new Panel();
         panel.setBackground(Color.lightGray);
         panel.add(new Button("Button 1"));
         panel.add(new Button("Button 1"));
         add("South",panel);
         Thread th = new Thread(anim);
         th.start();
    the animation
    import java.awt.*;
    import java.awt.event.*;
    //Animation Class
    class Animation extends Panel implements Runnable
    //     private Applet      appl;
         private Color       color;
         private int         increment, vincrement;
         private int         which;
         private int         position = 0;
         private int         vposition = 0;
         public  int         xCenter, yCenter;
         private int         pause;
         private int         width, height, speed;
         private double      distance;
         private Dimension[] rotations;
         private int         currentRotation ;
    Animation(Color c, int p, int wid, int hei ,int theSpeed, int Start)
         color  = c;
    //     appl   = a;
         pause  = p;
         width  = wid;
         height = hei;
         speed  = theSpeed;
         rotations = new Dimension[8];
         rotations[0] = new Dimension(1,0);
         rotations[1] = new Dimension(1,-1);
         rotations[2] = new Dimension(0,-1);
         rotations[3] = new Dimension(-1 , -1);
         rotations[4] = new Dimension(-1,0);
         rotations[5] = new Dimension(-1,1);
         rotations[6] = new Dimension(1,0);
         rotations[7] = new Dimension(1,1);
         currentRotation = Start;
         increment  = (int)rotations[Start].getWidth();
         vincrement = (int)rotations[Start].getHeight();
         setSpeed();
    public void setSpeed()
         increment  = increment  * speed;
         vincrement = vincrement * speed;
    public void changeRotation(int run, int rise){
         increment  = run;
         vincrement = rise;
         setSpeed();
    public void rotate()
         currentRotation++;
         if (currentRotation == 8) currentRotation = 0;
         changeRotation((int)rotations[currentRotation].getWidth(), (int)rotations[currentRotation].getHeight() );
    public void bounce()
         increment  = -increment;
    public void vBounce()
         vincrement = -vincrement;
    public void setColor(Color n)
         color = n;
    public void run()
         while (true)
              try
                   Thread.sleep(pause);
               catch (InterruptedException e) {}
              repaint(position,vposition,31,31);
              position  += increment;
              if (position > width - 30 || position <= 0) bounce();
              vposition += vincrement;
              if (vposition >= height - 30 || vposition <= 0) vBounce();
              repaint(position,vposition,31,31);
    public void update(Graphics g)
         this.paint(g);
    public void paint(Graphics g)
         width  = getWidth();
         height = getHeight()-4;
         Rectangle cl = g.getClipBounds();
         g.setColor(Color.pink);
         g.fillRect(cl.x,cl.y,cl.width,cl.height);
         g.setColor(color);
         g.fillOval(position,vposition,30,30);
         setCentre();
    public void setCentre()
         xCenter = position - 30/2;
         yCenter = vposition -30/2;
    public boolean didCollide(Animation x)
         distance = Math.sqrt( Math.pow( (xCenter- x.xCenter) ,2) + Math.pow((yCenter-x.yCenter) , 2) );
         if (distance <= 31) return true;
              else            return false;
    } Noah

  • Embeding PDF file into JPanel or JFrame

    Do any one have an idea on how to embed a PDF file into JPanel or JFrame?

    I can suggest you ways
    1)pdf to Image
    2)pdf to html
    http://www.verypdf.com/pdf2htm/
    Free online service
    http://www.gohtm.com/

  • Embed java applet in web dynpro

    Hi experts,
    is it possible to embed a java applet into a web Dynpro application. Or have I to use a jsp / Servlet / AbstractPortalApplication / (JSP)Dynpage
    Regards
    Fllo

    Hi
    yes its possible...
    go thorugh these docs..:[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/91b8c890-0201-0010-c787-be96f6fade89]
    [http://www.vogella.de/articles/SAPWebDynpro/article.html]
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8382535d-0d01-0010-dbb5-d3d41dfefd10]
    hpe it hlps u..
    Regards,
    Khushboo

  • Loading Applet in JPanel

    Hello there,is it possible to load an applet into a jPanel?
    if it possible can anybody tell me how to do it?

    well i figured out a way to reset my Internet Explorer Options, but that error is still coming up. Any ideas??
    thnx

  • How to embed swing component into javaFX ?

    Maybe I missed sth, but can someone explain us how can we embed swing component into javaFX 2.0 ?
    This was previously handled with javaFX "srcipt", why can't we do it anymore ?
    As far as the work to migrate from 1.3 to 2.0 is hard and huge, why do fx2.0 do not offer such feature anymore ? :(
    I know that ThingFx project try to cope with, but the current code doesn't match with my needs.
    Thanks for help,
    Edited by: tibO on 23 nov. 2011 14:35

    I know this post is old and the original authors might not even ben active; but it essentiall gets to the heart of what I'm trying to.
    I have a JDialogBox. In it I have a panel (which I have to change to a JScrollPane). Inside the JPanel I have a JLabel and a JTextArea.
    I was told to; make it scrollable in the event that there is too much info for the JDialogBox and to add HTML formatting (simple stuff like bold and colors.
    1) The JScrollBar doesn't seem to produce the scroll side bars.
    2) I must not be implementing the JEditorPane correctly. I just substituted JEditorPane for JTextArea in my code and it returned a type converstion error. Is JEditorPane even the correct object to use? Should I be using JTextPane?
    The reason I can't do this on a JLabel by JLabel basis is because I don't know how many labels I will need at each runtime. And I also have to have a swingtimer on it. I could create an array and loop around it to create the JLabels. But it seems a waste of commuting cycles. This is no good?

  • Embed a painting into a html web page

    Embed a painting into a html web page
    I have designed a 2D GUI interface that has many shapes.
    How can I embed it into a html web page or jsp?
    I have no idea about it.
    Thanks

    A demo:
    import java.awt.*;
    import java.applet.Applet;
    class TFrame extends Frame {
         private Button button;
         public TFrame() {
              button = new Button("Test");
              button.setSize(100, 20);
              button.setLocation(5, 5);
              this.add(button);
              this.setSize(300, 300);
    public class FrameTest extends Applet {
         public void init() {
              TFrame t = new TFrame();
              this.add(t);
              this.setSize(300, 300);
              And the HTML file:
    <html>
    <body>
    <applet code="FrameTest.class" width=300 height=300></applet>
    </body>
    </html>

  • How can I embed an iCal into iWeb in the new Lion OS/Cloud setup?

    I have found information on how to do this in the old software, but nothing on how to embed an iCal into my website (using iWeb) with the newest OS.  "Publish" no longer exists.

    If iCal can not publish a calendar, then with or without iWeb, the calendar is not available.
    Find another calendar, such as Google's :
    http://www.google.com/search?q=google+calendar
    Edit :
    http://www.google.com/search?q=html+calendar

  • When Editing A Web Page In Edge Animate, How Can I Embed Edge Elements Into Pre-Existing DIV's?

    I created a basic layout with some boxes in Dreamweaver. I set the Overflow property on them to "Hidden". I then opened the page in Edge Animate. However I noticed that when I import stuff, such as an image, then try to drag it into one of the existing DIV's, it won't work. It stays on top of all the other DIV's. However if I create a box or some other sort of DIV directly in Edge Animate, I can drag the Image element into that, so it's enclosed within that DIV.
    I guess the workaround appears to be to embed the image into the DIV in Dreamweaver first, then open the page in Edge. However it would be nice to not have to keep jumping back and forth like that. Is there a way to do this in Edge Animate?
    Also, I noticed when I select one of the DIVs I made in Dreamweaver, many of the Properties such as Corners, Shadow, and Filters are missing. Can these only be used on DIV's created directly in Edge Animate?

    Hi, neohtom-
    What you're seeing is the difference between what we define as a static div (one that is defined outside of Animate) and a managed div (one that is defined inside of Animate).  Due to the fact that we expect other products to change a static div, we limit the amount of changes you can make to a static div.  Because we "manage" a div that is created inside of Animate, we allow a lot more changes to be made to a div.  Hope that answers your question!  I'd suggest creating divs within Animate if you want to eventually change them to have corners, etc.
    Cheers,
    -Elaine

  • Is it possible to embed one form into another form?

    I have two Oracle 6i forms - Form A and Form B.
    Both forms are accessed independently at this time (from separate menu entries).
    I would like to add a new tab on Form A that, when selected, opens Form B within Form A (e.g. I wish to embed Form B into Form A).
    Is this feasible to do? I'm aware that it is possible to launch Form B from Form A (using a button) but we'd prefer to directly embed Form B into a tabbed window on Form A, if it is technically feasible to do.
    Greatly appreciate any suggestions or insight anyone can provide as per whether or not this is feasible.
    Kind Regards,
    Jeremy

    Thanks Andreas -- this is what I was assuming based on the research I've done so far.
    Would you happen to know if it is possible to open Form B (in a new window) when a tab is clicked on Form A, or can this only be done when a button is pressed on Form A (when-button-pressed trigger)?
    Regards,
    Jeremy

  • How to load a java card applet into a java card

    Dear All,
    I am a novice to java card technology..
    I have done some search on how to load a java card applet into a smart card but haven't found a satisfactory answer. I have read about installer.jar and scriptgen tool but I want to load the applet from a java program and not from command line. It would be of great help if somebody can help me out.
    If somebody can share a sample program which load a javacard applet(.CAP file) into a smart card, I will be very thankful.
    I am able to find some client applications which help us send APDU commands and recieve response APDU's to interact with an applet loaded on to the smart card but not application which actually load the applet.
    I have heard of OCF and GP.. some say that OCF technology is outdated and no longer in use.. can somebosy throw some light on this too..
    cheers,
    ganesh

    hi siavash,
    thanks for the quick response.. i checked out GPShell as suggested, it looked like a tool by which one can load an applet on to card and send some sample apdu commands... but I want to load the applet from the code.
    My application should look something like this.. it will be a swing applicaton where I have a drop down with a list of readers, I select the one desired and then click on "LOAD" after inserting a blank java card, at this point my applet which is stored in my DB should get loaded on to the java card. The next step should be to personalize it where I enter the values for the static variables of my applet and click "PERSONALIZE", at this point all these values should be embedded into APDU commands and sent to the java card for processing.
    For achieving this I am yet to find a comprehensive sample or documentation on the net.
    Please help...
    regards,
    ganesh

  • Inserting or embed and image into cfmail output from a database-stored path to an actual image.

    I am trying to insert or embed and image into cfmail from a database-stored path to an actual image. The actual JPEG image is stored in a folder called "images_personnel". The path to the image under the column titled photopath is stored in my database table as "/file/images_personnel/28.jpg". Displaying the image on the screen renders without a problem, embedding the same image as part of a cfloop query does not insert/embed the image into an email. All of the other output of the same cfloop displays and emails just fine. However none of the photos of each personelle show up. What an I doing wrong?
    My code is below:
    <cfquery name="Staffreport" datasource="master">
    Select staffreport.*, name.personnelid, name.email, name.last, name.noiid, stafflt, CONCAT(name.fname,' ',name.middle,' (',name.last,')') AS teammember, CONCAT(name.fname,' ',name.middle) AS teammember2, concat(name.photopath,'',name.photo)as hisphoto, stafflt.*, trim(concat(ltfname,' ',ltmiddle)) as LT from Staffreport, name, stafflt
    where 0=0
    and stalt = '#Session.user_id#'
    and ltid = '#session.user_id#'
    and staweekbegin = <cfqueryparam value="#form.staweekbegin#" cfsqltype="cf_sql_date" />
    AND staweekend = <cfqueryparam value="#form.staweekend#" cfsqltype="cf_sql_date" />
    AND stapersonnelid = personnelID
    <!---AND ltid = stalt--->
    AND CITY = 'richmond'
    AND STATUS <> 'd'
    AND STATUS <> 'T'
    AND type = 'personnel'
    Group by personnelid
    Order by teammember
    </cfquery>
    <cfmail>...
    <cfloop query="staffreport"><br />
    <table width="90%" border="0" cellspacing="2" cellpadding="4" align="left">
      <tr>
        <td colspan="2" align="center" valign="top" nowrap="nowrap" bgcolor="cccccc"><strong><font color="black"><cfif #staffreport.last# eq ".">#Ucase(Staffreport.teammember2)# <cfelse>#Ucase(Staffreport.teammember)#</cfif> - ID: <cfoutput>#Staffreport.noiid#</cfoutput></font></strong></td>
      </tr>
    <tr>
        <td align="left" valign="top" nowrap="nowrap" bgcolor="#000000">Name:</td>
        <td>#Staffreport.teammember#</td>
      </tr>
    <tr>
        <td bgcolor="E6E1FD">Photo:</td>
        <td bgcolor="EBEBEB">
    <img src="#staffreport.hisphoto#" alt="Photo" width="98" height="98">
    </td>
      </tr>
    <tr>
        <td bgcolor="E6E1FD">Email:</td>
        <td bgcolor="EBEBEB">#staffreport.email#</td>
      </tr>
    </table>
    </cfloop>
    </cfmail>

    You'll need to provide a full URL link to the image ("http://mywebserver/file/images_personnel/28.jpg"), not just a relative path.  Remember, the email client that is used to view the email content knows nothing of the internals of your web server - it can only follow a complete URL to get images and other resources.
    -Carl V.

  • Is there a way to "embed" -Xmx command into program

    Hi fellow members,
    I have been working on a program to analyze web page structural similarity and has been posting on this forum for some help recently. At the moment I manage to parse html into DOM tree and perform tree edit distance analysis.
    But I'm facing a problem which is heap memory running out. More complex web pages run up to >1000 nodes and the recursive comparing which has a time complexity of N^2 will cause outofmemory error. I have already reduced the number of nodes such as excluding text nodes as I'm primarily concerned with the structural similarity.
    By using -Xmx to increase the heap memory helps to solve the problem partially. I would prefer to embed this command into the program so that user does not need to type it out every time. Is there a way to do this?
    Thanks in advance.

    I see, thanks a lot guys, I will read up on batch file processing.
    But I'm wondering if I'm going to make it into a .exe file which will include the GUI in the near future, will I still need to write a batch file or any swing component can set the memory?
    One more wild question, is there a way to set heap memory to be dynamic, as in increasing according to the program needs?

  • Embed HTML Code Into Mail?

    Hi,
    Is it possible to embed HTML code into an Apple Mail message? If it isn't, this would be a really useful feature. Lots of sites now, such as YouTube and Flickr, provide snippets of HTML code that you can copy and paste into your "webpage". But how useful would it be if you could paste this code directly into an e-mail? That way you could do things such as embed a YouTube video into an e-mail, rather than just provide a link to it.

    You can do it, but it will not be the easiest thing, and it's generally frowned on, since HTML email is used by spammers and marketers to track whether or not you open their emails. It's much easier and more accepted to just send a link to something you want someone to see; not everyone has time time, patience, or affordable broadband to download a web page with an embedded video window.
    You'd have to do the coding yourself, test it to be sure it works when sending and receiving, and then send it to everyone you want to see it. That's a lot of work for no real benefit. According to Apple, Mail in 10.5 allows the sending of HTML using the Stationery feature; have you tested that or checked the Help files for that to see how it's done?
    Mulder

Maybe you are looking for

  • Rückspeichern auf DV Band mit JVC DVX 707 EG

    Hallo, ich arbeite mit Adobe Premiere Elements 10, Asus Computer mit Windows 7 und einem Camcorder JVC DVX 707 EG, der Mini-DV Bänder benutzt. Ich überspiele die Filme auf den Computer, bearbeite sie und spiele sie dann wieder zurück auf DV-Band. Lei

  • How to Re-classify cost from Project to Cost Center.

    There is a Project X   -  Its owner is Cost Center YYYYY. There is pressure to close Project X but we have commitments to the amount 4 milllion. We were thinking if there is a way to compensate this 4 million to Cost Center  YYYYY..., and close the p

  • Complaint regarding my Lumia 920

    To the person responsible, My name is Rana Abraham. I have a Lumia 920. IMEI number of the same is 3**************. The problems with this handset is that it overheats when any application that work based on internet is used.(The problem persists in

  • All office programs crash when I click on the File menu

    I can open files in every program fine but as soon as I go to the File Menu it puts up the "program" is not responding box Excel, Word and PowerPoint all crash when trying for the File Menu. Outlook will let me go to the File Menu but if I click on O

  • SAP Print to IFS

    Hi, Is it possible to set up a SAP printer that will send the spool to a text file on the IFS? Cheers, Dan