How to make JEditorPane support applet?

hi hi,
i would like to know how to make the JEditorPane support applet coming from internet source. i will be using JEditorPane to view web page but if it contains applet, how can i make JEditor support it? what should i need to do so. pls give me some guide lines. thanks

That's an interesting question. The short answer is, you can't. For one, the APPLET tag is ignored by the Swing HTML parser. Then, I'm not sure, what happens if you embedd heavy-weight components like applets into an editor pane.
However, you can use  JEditorPane e = new JEditorPane();
  e.setText("Hallo, Welt");
  e.setCaret(5);
  e.insertComponent(new JButton("Click me"));to add swing components to your text. So you might be able to create a working solution based on this foundation.
I can imagine two approaches. You could either create your own applet-like JEditorPanelets which would be basically JPanels with some glue code to allow the the panelet to access its editorPane.
Or you could explore the approach to add a heavy weight applet and write a compatiblily stub. Here's an outline  class AppletAwareEditorPane extends JEditorPane {
    List applets;
    MyAppletStub stub;
    public void insertApplet(Applet a) {
      applets.add(a);
      a.setStub(stub);
      a.init();
    public void startApplets() {
      Iterator i = applets.iterator();
      while(i.hasNext()) ((Applet)i.next()).start();
    }However, each applet would require to run in its own tread and I'm pretty sure this would break swing as it is not thread save.
bye

Similar Messages

  • How do I get rid of a few Internet sites, namely: Firefox is not supported? How to Make Firefox supported for these sites?

    Firefox does not support some web sites?
    How to Make Firefox supports these sites?

    Firefox does not support some web sites?
    How to Make Firefox supports these sites?
    This URL
    # http://e-imamu.edu.sa/emam/login/admin/CheckUserRegistrationAction.do
    # http://www.moi.gov.sa/wps/portal/!ut/p/c1/pY_RCoIwFIafKHY2t-mtztSlOSFW5o3sImKQGhE9f1oQFLiCzrn8_v9wPtSgcXtzs0dztUNvTqhGDW-ZqIQM1h5OK-0DSXy6EjwPgOGR73lbKqITKjEO-BID4RmNiq2ENPZ-ab-4KrMYJORxVChFaMr_aQP70t5NrvMJ6j25y23iMDMhfNx__y8X1Mkf9i4--bk4YajMhu6ANuaCzp3WNVhp5SK8A3BThH0!/dl2/d1/L0lDU0NTSUpKSkNncFJBISEvb0VvUUFBSVFKQUFNWXhpbElNNExnbWNBL1lCSkp3NDU0NTAtNGtzbHl0dyEhLzdfNUNQQ0k4TTMxT0Q0NTBJMFVGUkRVTDEwSDcvamF2YXguc2VydmxldC5pbmNsdWRlLnBhdGhfaW5mby8lMFRyYWZmaWNWaW9sYXRpb25zVmlldy5qc3A!

  • Simple introduction/tutorial on how to make Cocoa-Applescript Applets?

    I'm looking for a simple tutorial on how to make Cocoa-Applescript Applets.  I'm pretty new to Applescript, but fairly good at it, and I was wondering how Cocoa-Applescript Applets worked.  I was curious as I've been wondering if it was possible to somehow display images in Applescript, and it apparently is the only/easiest way.  My problem is that I haven't been able to find any tutorials on using it, so I was wondering if you guys could point me in the right direction, that'd be great!
    thanks in advance

    The main difference is with how the Cocoa APIs are used - in addition to the AppleScript and AppleScriptObjC release notes, there are some examples and resources at Mac OS X Automation.  Note that in Yosemite, AppleScriptObjC is available to all scripts, not just applets and libraries.

  • How to make iTunes support more than just one harddrive

    The title of this topic says it all: How do I make iTunes support more than just one harddrive? I cannot afford to buy a really huge drive just because iTunes doesn't support more than one.
    There must be a way around this! Anyone?

    I sure hope so. I run iTunes on an iBook G4 with limited space. I've got about 15gigs of music on an external harddrive. I only use the harddrive at home so I like to keep a handful of albums with me on the lappy. There should be some way to designate a primary folder on the laptop for imports, and a secondary (external or whatever) for the bulk of the library. Maybe some nifty way to do quick transfers between them within iTunes. Like a relocate function.
    Say I want the new death cab for cutie album on the laptop this week, but next week I want to swap it out with something new that comes out. It would be nice to highlight an album and select "transfer to secondary" so that iTunes can move the files for you, keep them organized, and keep track of them.
    That doesn't sound so difficult...

  • How to make sure an applet runs with Java 5?

    Hi all,
    First let me say thanks for all the help in the past. You've help me go from noob to intermediate noob. I've just about finished my first applet game which can be checked out here .
    Now I've been reading about problems with mac and 1.6. (note it works on Linux). I want to make sure that it runs fine and of course I don't own a mac. So I downloaded the 5 JDK. Selected it as the java platform in Netbeans, compiled and it ran fine.
    Questions:
    Do I have to always use 1.5 to compile and perhaps set it as default?
    Since it works in 1.5, do I compile it with 1.6 and just upload?
    I'm worried I'm not testing it correctly. I mean if I have both 1.5 and 1.6 installed on my machine, how to I make sure the applet is only using 1.5 to run?
    Thanks
    Darrin

    corlettk wrote:
    I haven't got a clue RE your problem other than for max-portability you should compile with [-target 1.5|http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javac.html].
    I must say I'm impressed, except I suspect my PC must be substantially faster than any of your test platforms... can you throttle it to CPU performance somehow? Or maybe it's just that my reflexes aren't what they once where.Thanks.
    There seem to be two issues. The first is what people are using. This web stats shows pretty poor penetration of 1.6.
    [http://www.statowl.com/java.php|http://www.statowl.com/java.php] Penetration: 54% with JRE1.6 + 19% with JRE 1.5. Total 73%.
    The second is I've read that mac and 1.6 do not get along except on a 64bit platform.
    So for applets there is not much choice but to compile on 1.5 for the broadest user base. I guess the good news is 1.4 and earlier are almost non-existent.
    Edited by: Darrin.A on Apr 27, 2009 8:11 AM

  • How to make graphics in Applet not to repaint after I click "refresh"

    Hi, pals
    I have some interactive graphics inside an Applet. User can drag and
    move the graphic objects. The problem is when user click "Refresh"
    button of the web browser, those objects return to their original
    positions. What I hope is to make those objects still lie on the new
    position that user has moved them to after they click "refresh" or
    "back" and "forward" button to return to the applet page.
    do I need to write some thread control?
    Think when you type new URL in the browser showing the applet and go to the new web page. The system will call
    Applet.stop() and destory() to destroy the applet resource used by the
    Applet webpage. When you go back to the applet page, the system will
    call Applet.init() and start() to recreate it. All previous object
    positions and states manipulated by user will return to original.
    For example, there's a circle centered at (50,50), you move it to
    center (100,100). Then you go to another webpage in the same web
    browser frame. When you use "Back" button to return to the Applet, the
    circle will be redraw at center (50,50). (why? because the browser call applet.init() and do all process as first time the applet download to your computer) What I hope is the circle still keeps
    at its last center (100,100) . This seems impossible to me
    since the applet has lost its memory about the center position
    (100,100) last time when you go to another page and the system call
    destory() to delete the applet.
    Any suggestion?

    I think you can disable page refreshing with javascript, but how, I do not know.
    I wish this is helpfull.
    Ahmad Elsafty

  • How to make a Java Applet work beyond proxy?

    Hi All,
    I have problems with my applet working through proxy.I am using a client applet which makes a socket connection to a Java application running on the same pc as the web server.
    Everything works fine when I am directly connected.However it does't work when connected through a proxy? I am using object o/p & i/p streams for the exchange of data b/w client applet & the server java application.How do I overcome this problem.
    Currently I am using WinGate 3.0.2 as my proxy(I did't see any firewaal setting there) but I intend to make applet work through any proxy for that matter.Using a higher level protocol such as UDP would help in this regard?
    This is urgent.PLease reply ASAP...
    best rgds,
    prithvi

    Try to use http, i don't thing direct open the socket can pass throught the socket if your proxy haven't forward those ports~
    Hi All,
    I have problems with my applet working through
    gh proxy.I am using a client applet which makes a
    socket connection to a Java application running on the
    same pc as the web server.
    Everything works fine when I am directly
    ly connected.However it does't work when connected
    through a proxy? I am using object o/p & i/p streams
    for the exchange of data b/w client applet & the
    server java application.How do I overcome this
    problem.
    Currently I am using WinGate 3.0.2 as my proxy(I
    (I did't see any firewaal setting there) but I intend
    to make applet work through any proxy for that
    matter.Using a higher level protocol such as UDP would
    help in this regard?i think UDP/TCP is not the matter for that!
    This is urgent.PLease reply ASAP...
    best rgds,
    prithvi

  • How to make a scrollable applet

    How do I make an applet scroallable? Not a scrollpane within an applet but instead make the whole contentpane for the applet as a scrollable pane if the content within the applet�s contentpane is too small to view all the added content. Or if the applet is added to a frame to be run as an application and the frame size is decreased.
    That is, how do I make a scrollpane that fills the whole contentpane for the applet and is resized together with the applet�s contentpane? What do I for example have to add to this little applet to make it�s contentpane scrollable?
    public class Applet extends javax.swing.JApplet
        public void init()
            // Initialization of the applet pane
            getContentPane().setBackground(java.awt.Color.WHITE);
            getContentPane().setLayout(null);
            // Adds some content
            JLabel label = new JLabel("Applet application");
            label.setSize(100, 20);
            label.setLocation(10, 10);
            getContentPane().add(label);
    }It is probably very easy but I can�t figure it out myself yet, I am still too new to Swing : )

    Thank you for your answer, but I am not quite happy yet ...
    What is it so bad with use of null-layout? I have found that I can use exact positioning using setLocation if I set use null-layout which I can�t with for example BorderLayout. It is even worse, the BorderLayout makes the UI ugly by size of the content to fill one out of five "cells". But I know I am wrong when I say nul-layout is fine because many other also complains on null-layout, I just don�t know why I am wrong?
    But any way, with null-layout, something like this ...
           JPanel contentPane = new JPanel(new java.awt.BorderLayout());
           getContentPane().add(new JScrollPane(contentPane));
           JScrollPane scrollpane = new JScrollPane();
           scrollpane.getViewport().add(getContentPane());
           // Initialization of the applet pane
           contentPane.setBackground(java.awt.Color.WHITE);
           contentPane.setLayout(null);
           contentPane.add(table);do I just get a white empty area. If I instead use a BorderLayout like in your example do the table fill the whole space, and that does not look too beautiful. Couldn�t I instead get a pane with some absolute positioned elements that has some space around them scrollable?
    I guess I am on the wrong direction now : ) but I then need someone to teach me why?

  • How to make 8830 support chinese sms in cdma network?

    Hello,i have been using 8830 for many years,in cdma network,it cannot show or send chinese sms,how to solve this problem?

    Hi mike_jeson,
    Welcome to BlackBerry Support Community Forums.
    Language support availability is determined by your wireless provider and is available for installation in your BlackBerry Device Software. You can download the most recent version of BlackBerry Device Software from your provider's download site in the following list. http://bbry.lv/ad7CII This article should help you install available language packs. http://bbry.lv/9IpPf9
    -FS
    Come follow your BlackBerry Technical Team on Twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.
    Click Solution? for posts that have solved your issue(s)!

  • D-Link DBT-122 USB Bluetooth Adapter - how to make it support 2 devices?

    For Macs not originally equipped with Bluetooth hardware Apple used to recommend purchasing D-Link's DBT-120 (rev. B or later). If I understand correctly, after pluggin-in the device it was necessary to run Apple's Bluetooth Firmware update 1.3.3 to get it working.
    The DBT-120 device may still be available for purchase in some parts of the world but in Europe D-Link is now selling the replacement DBT-122 (no revision is indicated). The device is advertised as being 'Mac-compatible (check, for instance, http://www.dlink.co.uk/?go=gNTyP9CgrdFOIC4AStFCF834mptYKO9ZTdvhLPG3yV3oVIF+h6ltb NlwaaFp6DQoHDrqyyRF/okIB9vv ).
    My problem is after having plugged-in my brand new DBT-122 onto an USB port of my 'old' G4 eMac, I can get my Bluetooth Mighty Mouse working, or my Bluetooth Apple Keyboard working, BUT NOT BOTH AT THE SAME TIME. When I have them both connected, disconnections occur all the time (either the mouse or the keyboard, apparently at random).
    Tried to run Bluetooth Updater 1.3.3 but the thing tells me that there is no Bluetooth device to update. I suppose it is loooking for a DBT-120 and I have a DBT-122.
    Anyone with a suggestion on anything I should try to have both my mouse and keyboard working via my new bluetooth adpater?
    (No use to contact D-Link support, they don't know anything about Macs and the only thing they have been instructed to respond is 'its an Apple problem'. And they charge you for that - the hotline is expensive!)
    Cheers

    Hi,
    i'm having the same problem. The Apple Store recommends purchasing the D-Link DBT-120, but doesn't actually sell it since it has been superceded by the DBT-122 in Europe. Apple should know this. While D-Link market the DBT-122 as the replacement for the DBT-120 that is also compatible with Macs, from what i have been able to find out the 120 and the 122 use different chipsets and OSX cannot recognize all the features of the DBT-122's firmware. That is also why OSX's firmware updater software doesn't work with the DBT-122.
    Like you, i can get the DBT-122 to work with either the keyboard or mouse but not both at the same time.
    In any case even if you got both the keyboard and mouse working wirelessly there would be no way of waking the computer from sleep since the 'allow bluetooth device to wake computer from sleep' option is greyed out - this is only available if the firmware is supported. Presumably Apple will have to release software to support the DBT-122, if the earlier model is no longer in production. I think both Apple and D-Link are at fault here.

  • How to make JEditorPane acting like Windows on-line Help ?

    Hello all!
    The JEditorPane is able to show html inside it. Is there the possibility to be able to click on links in it? (e.g. <a href=")?
    Thanks in advance for the help
    Cdlang

    Sounds like you haven't bothered to look at the javadoc:
    [http://java.sun.com/javase/6/docs/api/javax/swing/JEditorPane.html]

  • How to make SSL supporting configuration

    Dear Friends,
    I got the following exception once when my connection routes through SSL, ie., https
    Kindly convey do i need any specific configuration needed to support SSL.
    java.lang.ExceptionInInitializerError
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at java.net.URL.getURLStreamHandler(Unknown Source)
         at java.net.URL.<init>(Unknown Source)
         at java.net.URL.<init>(Unknown Source)
         at java.net.URL.<init>(Unknown Source)
         at com.adventnet.nms.util.NmsClientUtil.constructURL(NmsClientUtil.java:4004)
         at com.adventnet.nms.util.NmsClientUtil.getTimeToLiveToken(NmsClientUtil.java:3914)
         at com.adventnet.nms.startclient.WebNMSClient.doconnect(WebNMSClient.java:649)
         at com.adventnet.nms.startclient.WebNMSClient.run(WebNMSClient.java:2132)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.security.AccessControlException: access denied (java.security.SecurityPermission putProviderProperty.SUN)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkSecurityAccess(Unknown Source)
         at java.security.Provider.check(Unknown Source)
         at java.security.Provider.put(Unknown Source)
         at com.sun.javaws.WinBrowserSupport.getSecureRandomImpl(Unknown Source)
         at com.sun.javaws.BrowserSupport.getSecureRandom(Unknown Source)
         at com.sun.javaws.net.protocol.https.Handler.<clinit>(Unknown Source)
         ... 11 more

    What version of Java Web Start and J2SE are you using ?
    /Dietz

  • How to make packages for applets

    hi all...
    i tried the following code for applets
    package imp;
    import java.awt.*;
    import java.applet.*
    <applet code="Ex1" widt=400 height=400>
    </applet>
    public class Ex1 extends java.applet.Applet
    ---------code------
    and then i complied and used applet viewer to start the applet...but it gave the error access denied
    without the packaging, this worked fine
    regards,
    kalyan

    and then i complied and used applet viewer to start
    the applet...but it gave the error access denied If I remember correctly, when you have a package to the class, the class file should be placed in a subfolder called imp and the applet tag should use the fully qualified classname imp.Ex1

  • How to  make a good voip server +applet ?

    Here is my applet wich I made http://84.244.8.225/test.html
    It works a bit
    Here the code:
    http://84.244.8.225/javamic4.txt
    Any ideas/suggestions to make it better...
    (for example how to make a good server (windows) ?)
    Thx!
    Edited by: FrederikPot on Sep 24, 2007 3:01 PM
    Edited by: FrederikPot on Sep 24, 2007 3:03 PM
    Edited by: FrederikPot on Sep 24, 2007 3:07 PM

    Hello Thanks for your replys and sorry for being so fussy about this.
    I have now seen that one of the options for exporting from Premiere 6.5 is Adobe MPEG encoder. So Do you guys think it would be a good idea to do it with that, Or Would it be better AVI or DV AVI compressor from Premiere before making the DVD?
    I have the Nero Vision 4.9.6.6  But I may be able to look for another one if you think it is better...
    Thanks a lot for your advises...

  • How to make Solaris 8 UNICODE supported

    My Solaris 8 doesn't support UNICODE. That's why, I can't write � in a file.
    I think UNICODE support will remove this problem
    How to make Solaris 8 UNICODE supported.

    In the initial "dtlogin" screen, select a "UTF-8" locale when you login.
    You may have to install additional locale files for UTF-8 support from the Solaris "Languages" CD.

Maybe you are looking for

  • Pdf icon preview randomly not showing on desktop

    I have no idea why this has been happening, but for some reason, the pdf preview icon on my desktop shows the preview of some pdf's in the icon, and at random, only shows the generic icon on others. Quick Look works fine. This phenomenon is constantl

  • Can anyone suggest a legit download to transfer music from ipad mini to macbook?

    someone transferred my ipod music to my ipad and i want to transfer it to the mac now.  (the ipod is dead) Any suggestions on a legit music transfer downloader? Thanks!

  • How to pass a single character to dll (as a parameter)

    How do pass a single character to dll (as a parameter). This is a third party dll that i am unable to change. e.g.: int functionName(char* process, char myChar);

  • ATTN: APPLE, Please read this!!

    I love my new Iphone 4 but but please provide a way to turn off multitasking. It wastes the battery if not used.

  • Web RRI

    Hi Friends, I have created a Jumptarget as a R/3 transaction for a query. It is working fine with BEx by prompting R/3 client, where as it is not working with WAD. Indeed I can see the transaction when I click on that it displays No Page display. In