Why won't my HTML page display my applet?

I can't figure this out. It works fine through Sun's appletviewer. Here is my HTML code:
<applet code="backGroundSwing.class" height=200 width=500></applet>
Here is my applet code:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.event.*;
//<applet code="backGroundSwing.class" height=500 width=500></applet>
public class backGroundSwing extends JApplet{
     sprite pane;
     JButton red = new JButton("Red");
     JButton green = new JButton("Green");
     JButton blue = new JButton("Blue");
     JButton cyan = new JButton("Cyan");
     JButton yellow = new JButton("Yellow");
     JButton orange = new JButton("Orange");
     public void init(){
          Container contentPane = getContentPane();
          pane = new sprite();
          contentPane.add(pane);
          pane.add(red);
          pane.add(green);
          pane.add(blue);
          pane.add(cyan);
          pane.add(yellow);
          pane.add(orange);
          red.addActionListener(new ActionListener(){
               public void actionPerformed(ActionEvent event){
                    pane.setBackground(Color.red);
          green.addActionListener(new ActionListener(){
               public void actionPerformed(ActionEvent event){
                    pane.setBackground(Color.green);
          blue.addActionListener(new ActionListener(){
               public void actionPerformed(ActionEvent event){
                    pane.setBackground(Color.blue);
          cyan.addActionListener(new ActionListener(){
               public void actionPerformed(ActionEvent event){
                    pane.setBackground(Color.cyan);
          yellow.addActionListener(new ActionListener(){
               public void actionPerformed(ActionEvent event){
                    pane.setBackground(Color.yellow);
          orange.addActionListener(new ActionListener(){
               public void actionPerformed(ActionEvent event){
                    pane.setBackground(Color.orange);
     class sprite extends JPanel{
          sprite(){

No, all the other applets use AWT. I think I have the plug in. At least, on my control panel, I have an icon that says:
java 1.3.1 plug in.
Is there a way that people with out any java software installed on there computer except a java enable browser view my swing applets?
Here is my source code:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.event.*;
//<applet code="backGroundSwing.class" height=500 width=500></applet>
public class backGroundSwing extends JApplet{
     sprite pane;
     JButton red = new JButton("Red");
     JButton green = new JButton("Green");
     JButton blue = new JButton("Blue");
     JButton cyan = new JButton("Cyan");
     JButton yellow = new JButton("Yellow");
     JButton orange = new JButton("Orange");
     public void init(){
          Container contentPane = getContentPane();
          pane = new sprite();
          contentPane.add(pane);
          pane.add(red);
          pane.add(green);
          pane.add(blue);
          pane.add(cyan);
          pane.add(yellow);
          pane.add(orange);
          red.addActionListener(new ActionListener(){
               public void actionPerformed(ActionEvent event){
                    pane.setBackground(Color.red);
          green.addActionListener(new ActionListener(){
               public void actionPerformed(ActionEvent event){
                    pane.setBackground(Color.green);
          blue.addActionListener(new ActionListener(){
               public void actionPerformed(ActionEvent event){
                    pane.setBackground(Color.blue);
          cyan.addActionListener(new ActionListener(){
               public void actionPerformed(ActionEvent event){
                    pane.setBackground(Color.cyan);
          yellow.addActionListener(new ActionListener(){
               public void actionPerformed(ActionEvent event){
                    pane.setBackground(Color.yellow);
          orange.addActionListener(new ActionListener(){
               public void actionPerformed(ActionEvent event){
                    pane.setBackground(Color.orange);
     class sprite extends JPanel{
          sprite(){
     

Similar Messages

  • Incorrect functionality of Embedded tag in html page, displaying object on top of all layers of Adobe air application native window

    Title
    Incorrect functionality of embed tag in html loader for adobe air development
    Description
    Problem Description: If we had loaded youtube.com video url in a view stack and navigate to other index of stack or away from we UI screen within the same native window video or embeded tag of flash player or any other embed object will be displayed on top of all screens layer in same position of where the object should be placed in side of html loader only.
    Steps to Reproduce:
    1) go to http://get.straweb.com/StraWebBrowser/StraWebBrowser.air download and install
    2) load 2 tabs and in the 3 tab load video player of youtube.com which will a sample video
    before completing the load of 3 tab which trying to load video from youtube.com, navigate to other tabs 1 or 2 in few second once the flash player of youtube.com video player is load it will display in the current tab or UI screen.
    3) Try navigating to other tabs than youtube.com loaded tab you see the flash player is on top it stable.
    4) navigate to 3 tab and try to navigate to other tab you can observe that so how it will not show that flash player and only visible in that 3 tab which is fine.
    Actual Result: Embedded tag of html page displaying on top of all layers of Adobe air application native window
    Expected Result: Embedded tag of html page should only displayed in side htmlloader
    This you can replicate in any adobe air plugin update and on any Hardware and Environment.
    Applicable to all sdk versions of adobe air.

    Adobe Bugbase: Bug 3823839 Incorrect functionality of embed tag in html loader for adobe air development

  • Why won't my Apple TV display the setup screen?

    Why won't my Apple TV display the setup screen? I have changed hdmi cable, confirmed the correct input, checked connection but nothing. HELP!!! I have a Bose System and use a universal remote, Logitech. Could this be a factor?

    Welcome to the Apple Community.
    What exactly does your Apple TV display.

  • Why won't my PowerPoint presentations display correctly?

    Why won't my PowerPoint presentations display correctly?

    In what app? As an email attachment? In another PP compatible iOS app?
    Sometimes there are formatting issues with going from the MS office version of a document and opening it in an iOS app that is compatible with the MS file. The apps that are compatible with the MS Office suite of apps do not always open and display on the iPad the same way that they do in Office on your computer.
    The iPad is not a full blown computer by any means and this is one of those trade offs that you sometimes have to accept if you want to use the iPad instead of a computer.

  • Just upgraded to snow leopard, downloader apple support drivers for canon mp620.  Why won't a printer list display in add printer window?

    Just upgraded to snow leopard, downloader apple support drivers for canon mp620.  Why won't a printer list display in add printer window?

    Assuming the MP620 is connected to your wireless network, then there are two components to this device - the printer and the scanner. The printer uses Canon proprietary software while the scanner is supported by Apple's Bonjour service. So in many cases, you will at least see the scanner, shown as Bonjour Scanner in the Kind column, while the printer can take longer to appear and is shown as canonijnetwork in the Kind column. If you cannot see either then you have a network issue. Try turning off the MP620 for a minute and then turning back on. Then see if the scanner / printer component appears in the Add Printer window. If you still don't see either, then confirm the MP and the Mac are using the same network. If you know the MP's IP address you can use Network Utility to Ping the address. You can also enable Bonjour Bookmarks in Safari preferences and when selected, the MP620 should appear.

  • Printing HTML PAGE in a Applet

    I am tryng to print a HTML Page in a Applet .
    When Using Eclipse Environment everythig goes fine.
    Now I am trying to use the appletviewer to run the same
    source, but it appears the following:
    http://10.15.1.26/
    Conecting to http://10.15.1.26/
    Exception in thread "AWT-EventQueue-2" java.lang.RuntimeException: java.security.AccessControlException: access denied (java.net.SocketPermission 10.15.1.26:80 connect,resolve)
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(Unknown Source)
         at java.net.HttpURLConnection.getResponseCode(Unknown Source)
         at javax.swing.JEditorPane.getStream(Unknown Source)
         at javax.swing.JEditorPane.setPage(Unknown Source)
         at javax.swing.JEditorPane.setPage(Unknown Source)
         at javax.swing.JEditorPane.<init>(Unknown Source)
         at AppletPrintHTML$EditorPaneHTMLViewer.loadStartingPage(AppletPrintHTML.java:90)
         at AppletPrintHTML$EditorPaneHTMLViewer.<init>(AppletPrintHTML.java:103)
         at AppletPrintHTML$5.actionPerformed(AppletPrintHTML.java:364)
         at java.awt.Button.processActionEvent(Unknown Source)
         at java.awt.Button.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.security.AccessControlException: access denied (java.net.SocketPermission 10.15.1.26:80 connect,resolve)
         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.checkConnect(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.http.HttpClient.<init>(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    Why I am not allowed to connect to the site without Eclipse? Any Idea?
    Angel Portal

    This code
              * Load a HTML Page
              private void loadStartingPage() {
              try {
                   System.out.println("Conectando a "+ path);
                   mainPane = new JEditorPane(path);
                   } catch (IOException e) {
                        System.err.println("N�o Pode Conectar");
                        System.exit(1);
    Open a html page ( path ) on JEditorPane!
    In Eclipse worked just fine!
    But if I try to do that on a Browser or appletviewer the error a told you shows up.
    I am reading about the The Permission Classes.Someone have heard of it?

  • Replace HTML page with an applet

    Hello to everybody!
    I created a servlet who can manage file upload from an HTML page.
    Now I want to replace that HTML page with an applet.
    I know that I need to use multipart/form-data , but I have no experience with applet.
    HTML page code is:
    <html>
    <head><title>Upload</title></head>
    <body>
    <FORM ACTION="http://localhost:8080/examples/servlets/servlet/UploadTest" ENCTYPE="multipart/form-data" METHOD=POST>
    What is your name? <INPUT TYPE=TEXT NAME=submitter> <BR>
    Which file do you want to upload? <INPUT TYPE=FILE NAME=file> <BR>
    <INPUT TYPE=SUBMIT>
    </FORM>
    </body>
    </html>
    Any help for "translating" this html page into an applet?
    Applet will send, like html page, a string and a file.
    Thanks in advance, Liuk

    If you use something like Apache Http Client you dont have to do any low level implementations.
    Also if you are the one who is writing both servlet and applet you dot have to stick to standerd formats. you can develop your own format and write both servlet and applet to handle it. that kind of thing can be done easily even with URLConnection. But if you plan to send large files then URLConnection may not be the right option becouse I have seen many complaining that URLConnection gives OutOfMemoryErrors when uploading large amounts of data.

  • How to display an image on the HTML page by using applet

    Dear friends,
    I am now writing an java applet, I want to display an image on the HTML page, and tried the following commands:
    {color:#ff00ff}{color:#000000}Image map; //put in the class definition
    map=getImage(getCodeBase(),"hhh.gif"); //put in the function of init()
    g.drawImage(map,0,300,this); //put in the function of paint(){color}
    {color}
    However, when I run it, the image wasn't displayed at all.
    I hope who guys ever come across this problem could help me to solve it. Thank you in advance!
    Hawaii

    Hi,
    I am no expert on Images
    but
    from personal exp.
    are you sure that map actually contains the image?
    try using
    ImageIcon ii = ImageIcon(String name);
    map = ii.getImage();I saw a tutorial on images i think on sun
    where they use ImageIcon to load the image

  • Call a html page from a applet

    did somebody can tell me how call any html page to display in the current window of the browser when the user push a Button in one applet

    http://forum.java.sun.com/thread.jsp?forum=31&thread=566530&start=1&range=1
    or
    http://forum.java.sun.com/thread.jsp?forum=31&thread=566059&tstart=0&trange=100

  • Open a html page from an applet

    Hi,
    I would like to open, from an applet, an HTML page in a new window with a specific width an eight.
    Who can help me ?

    Here is an example of applet to javascript with liveconnect:
    http://www.narhari.com/java/applet2javascript/
    You can use the send(String) method from the sample applet to send something like:
    window.open('xyz.html','myPopup','width=200,height=200');in order to open a window with specific dimensions
    of course you can also build HTML in your applet and use send() + some javascript to render it.

  • How to call and run HTML pages from an Applet?

    I want to run another HTML page when pressed a button in an Applet,how can i do it?

    Are you looking for this?
    applet.getAppletContext().showDocument("http://cullenwines.com.au", "_top");

  • Viewing html page of an applet

    I am trying to write an applet.
    When I viewed the html page for the first time,
    it worked fine.
    But now it doesnt work properly.
    All the contents are not shown.
    I recompiled my code but the mistake remains.
    Please help

    Probably need to refresh the web browser cache; usually the browser "Refresh" function will do that; or close ALL browser windows and then try it again.

  • How to call html page from an applet

    I want to call a html page after the user presses a OK button in the applet. please help me in this.

    In you actionPerformed put:
    AppletContext appContext=getAppletContext();
    URL myURL= new URL("http://www.javasoft.com");
    String target="_self";
    appContext.showDocument(myURL,target);P.S. If you want to pen the URL in a new Browser window
    use
    target="_blank";

  • Why won't launchpad will not display the second page?

    I can see the first page. But when I attempt to see the second page, by swiping with two fingers or hitting the tiny dot, the second page appears for a moment, but then returns to the first page. I have tried closing all my open applications. This is new behavior. I have Mtn Lion.

    Same problem here. only i'm on page 2 and it won't let me stay on page 1 long enough to click on any of my apps there

  • Why won't my old Pages docs open with the old Pages application?

    I have a whole suite of complex documents created with the old Pages - which will not open with the old Pages application. Why not? The new app appears not to have things I need - like autoflow to complex linked boxes for example, or easy kerning.
    Is there a workaround to so that I can access my documents without having to redo them? I don't want to use the new app. It's hideous, lumpen and unsophisticated. Why has a decent product been replaced with crap?

    Can you clarify that?
    What version is "the old Pages"?
    What version of OSX?
    What happens when you try and open an old document with the "old Pages"?
    Are you really saying that Pages '08/'09 won't open Pages 5 documents?
    Because that is not a surprise, you need to Export the newer version documents back.
    Peter

Maybe you are looking for

  • [help me] Oracle 10G + ASM "ORA-00376: file 5 cannot be read at this time"

    We have used Oracle 10G R2 RAC + ASM on Redhat 4 (EMC cx700 Storage) I found below errors on alert log and can't inserted, updated and deleted datas in database. Sun May 27 01:12:34 2007 SUCCESS: diskgroup ARCH was mounted SUCCESS: diskgroup ARCH was

  • Just found out I cannot get iPhone unless I pay full price...very upset

    My wife and I just went to the Verizon Wireless store and were told that we could not get the iPhone without paying a ridiculous amount of money.  I had just assumed that current customers, who had displayed loyalty to their company, would be able to

  • Duplicate records in flat file extracted using openhub

    Hi folks I am extracting data from the cube to opnhub into a flat file, I see duplicate records in the file. I am doing a full load to a flat file I cannot have technical key because I am using a flat file. Poonam

  • TXT file generation

    Dear all, I was wondering what would be the best way to handle a txt file generation from SAP on a daily basis required for futher treatment by an external system. Type of data: SD/MM Volume of data is not that big (10 k) Frequency once a day (night

  • Regarding how to add the letters(forms) to the infotype?

    hi , in my requirement is creating new infotype with adding the Letters(forms) . how to add the lettersto infotype. thanks & regards, srinu.