Running JFrame on browser

I wrote a program that makes small calculations in JFrame. My question is, how can I integrate it in a browser like JApplet?

Here is the source:
import javax.swing.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class MyApplet extends JApplet {
     private JButton showBtn;
     private JFrame myFrame;
     private JButton closeBtn;
     public MyApplet() {
          init();
     public void init() {
          showBtn = new JButton("Show Frame");
          showBtn.setSize(100, 20);
          showBtn.setLocation(5, 5);
          myFrame = new JFrame();
          closeBtn = new JButton("Close");
          closeBtn.setSize(100, 20);
          closeBtn.setLocation(5, 5);
          myFrame.getContentPane().setLayout(null);
          myFrame.getContentPane().add(closeBtn);
          myFrame.pack();
          myFrame.setSize(500, 300);
          myFrame.setLocationRelativeTo(null);
          myFrame.setTitle("Demo Applet");
               closeBtn.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent evt) {
                         myFrame.setVisible(false);
               showBtn.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent evt) {
                         myFrame.setVisible(true);
          this.add(showBtn);
          this.setSize(300, 300);
}All of the resulting .class files were placed in an archive called MyApplet.jar
Here is the HTML tag:
<applet code = "MyApplet.class" archive = "MyApplet.jar" width = 300 height = 300/>Any more questions?

Similar Messages

  • How do I get you to stop showing me all this unwanted crap and just run the damned browser?

    I have 3.6 downloaded but it wont run because I can't get passed all the other crap customizing and just run the damned browser. That is all I am interested in, none of the other bull crap. What is so hard to understand? Keep it simple stupid. All I need is the Browser OKAY! Everybody in the world don't want that crap! Make it simple for people like me who hate this computer generation because it is all becoming about laziness and stupidity. Computers make people stupid not better. They are only a tool but technology and so called educators have taken the usefullness to far and most kids can't do math or history without some kind of cheating device. What are you gonna do when the computers die and the internet fails? Get a pen and paper, read some books and take a few investigative notes. Computers are not the answer to our problems.

    Make sure that the getpersonas.com site is listed as an install exception:
    Tools > Options > Security : "Warn me when sites try to install add-ons": Exceptions
    Make sure that you do not use [[Clear Recent History]] to clear the 'Site Preferences'.

  • I wanted a solution to the problem I was having on Win 7 Pro Service Pack 1 in that links on an open Adobe Acrobat file will not open in my Firefox Browser 33.0.2. The Error I receive is "Acrobat could not run the web browser.  Unknown Error. (123)"

    I want a solution to the problem I was having on Win 7 Pro Service Pack 1 in that links on an open Adobe Acrobat Pro 10.1.12  file will not open in my Firefox Browser 33.0.2. The Error I receive is "Acrobat could not run the web browser.  Unknown Error. (123)"

    Change browsers. See what happens.
    Be well...

  • Not able to clear session of web application running inside wpf browser control

    Hi,
    I have used below code to clear session of web application running inside wpf browser control .   
    [DllImport("wininet.dll", SetLastError = true)]
       private static extern bool InternetSetOption(IntPtr hInternet, int dwOption, IntPtr lpBuffer, int lpdwBufferLength);
     InternetSetOption(IntPtr.Zero, INTERNET_OPTION_END_BROWSER_SESSION, IntPtr.Zero, 0);
    This code is working in Windows 8 but it is not working in windows 7 and windows 8.1.
    I want to know why it is not working and how to make it work in windows 7 and windows 8.1
    Please help.
    Thanks & Regards,
    Pritesh

    Hi,
    I have used below code to clear session of web application running inside wpf browser control .   
    [DllImport("wininet.dll", SetLastError = true)]
       private static extern bool InternetSetOption(IntPtr hInternet, int dwOption, IntPtr lpBuffer, int lpdwBufferLength);
    InternetSetOption(IntPtr.Zero, INTERNET_OPTION_END_BROWSER_SESSION, IntPtr.Zero, 0);
    This code is working in Windows 8 but it is not working in windows 7 and windows 8.1.
    I want to know why it is not working and how to make it work in windows 7 and windows 8.1
    Please help.
    Thanks & Regards,
    Pritesh

  • Flash swf that runs on every browser except in Firefox. Can anyone help me please?

    Hello.
    I have an flash swf in a site that runs on every browser except in Firefox. I get an warning telling me that the page requires a newer version of flash player but i already have the 10,0,32,18 and the swf was published for flash player 9.
    Can anyone help me please?

    The figures you mention only make sense on your intranet.  Are you still using the same wireless router.  The verizon one is somewhat limited as far as max wireless-n performace.  For one thing it only has a 2.4 radio.   I like many people who wanted wireless-n performance before they even added a wireless-n gigabit router, have my own handling my wireless-n network.

  • Unable to run form in browser

    Hi friends,
    when i click the run button the browser has opened and closed immediatly.before it was working properly.
    i tried both of mozila and IE,and checked run time tab in Preference.its ok same like other client systems.
    i take that
    http://oraclient4:8889/forms/frmservlet ant put into browser samething happend.
    what are the reasons for this problem?

    Is it for the first time that ur running a form from Form Builder after installation??
    If Yes then u have to run jinitiator first..
    or just try to run test.fmb file from ur form builder.
    If No then it may be due to some compilation error..
    just compile ur form using shift+ctrl+k.
    then ctrl+T
    then ctrl+R

  • How to make adobe flash player content on websites run on safari browser of my ipad?

    How to make adobe flash player content on websites run on safari browser of my ipad?do I have to install adobe flash player on my ipad ?

    The flash add-on is not available for Safari on iOS. Never has been and in fact Adobe has ceased support for flash for mobile devices in general. Your options, depending on the specific sites:
    See if the site or sites in question have their own apps availabel in teh app store
    Look into some browsers such as Puffin adn iSwifter (there are others, I beleive). These browsers use a third server site to translate the flsh content into a form that the iPAd can use and restreams them to you. They may not work with all content.
    Use a computer capable of running flash.
    Seek a source of the conent that is designed for non flash use.

  • When I run a web browser immediately loaded two blank tabs. How to make the browser load the only one?

    when I run a web browser immediately loaded two blank tabs. How to make the browser load the only one?

    Did you check the home page setting to make sure that if doesn't have pipe (|) symbols?
    See these articles for some suggestions:
    *https://support.mozilla.org/kb/Firefox+has+just+updated+tab+shows+each+time+you+start+Firefox
    *https://support.mozilla.org/kb/How+to+set+the+home+page - Firefox supports multiple home pages separated by '|' symbols
    *http://kb.mozillazine.org/Preferences_not_saved

  • HOW TO HIDE MDI WINDOW INFORMS 9I WHEN THEY RUN IN WEB BROWSER

    Hi. Will any body tell me how to hide the default MDI window title in Forms 9i when it run in Web Browser. I am using the "Look and feel" property as "Generic" in Formsweb.cfg file. I tried the RESIZE,POSITION,MINIMIZE,VISIBLE FALSE properties of SET_WINDOW_PROPERTY FUNCTION, But the horizontal Bar at the top displaying "Window" on it, is displayed. OR some time form is not displayed at all. So plz help me. This kindness of any one will be appriciated.
    Regards
    Inayat Qazi

    Hi Inayat,
    To remove the ORACLE icon, change the line "logo=" to "logo=x" in file formsweb.cfg.
    I am not sure if it is possible to remove the standard-menu (horizontal bar with word Window, as you describe it), because as far as I know it is inheritance for the Windows OS. In other words, removing the standard menu can only be achieved if you run on another OS.
    Kind regards.

  • Could not run the web browser

    I've installed Reader 7.0.9 in order to read ebooks. When I try to activate the mobile device, reader responds with "Acrobat could not run the web browser. Unknown error. (0)". Is there a plug-in missing or corrupted control somewhere. Any suggestions. This is XP SP2 (and SP3) on a Dell Precision.
    Any suggestions.

    Let me amend my comment. Reader 7 might have been tested with XP SP2,
    but with all the changes in the OS due to security changes, OS changes
    and browser changes, Reader 8.1.3 or Reader 9 would be a better match to
    your software.
    Mike

  • How to Run Swing in Browser

    Hi frnds
    I gotta a Problem in swing.I want to run my swing in Browser.I have tried it with JApplet.But i can execute it only in Console.using appletviewer <filename>.html
    how to run it in browser.
    Please Help Me..

    Quite easy, well for you. You have to have the newest java plug in working in your browser, but as a flaw, if a user wants to access it they need to download it too, but there is a way in the new JDK i believe to have the JRE on Suns server to run the applet, so the user w/o the Swing librarys can use the applet w/o problems

  • How to run report in browser

    hi every body,
    please tell me , i have developed a simple report in 10g report builder (oracle developer suite)
    but i m unable to run it
    my 10g forms are running well in browser by using
    http://<Machinename :8889>/forms/frmservlet?config=<config_tag>
    Please advise me how to test or runb the report in browser same as form
    and tell me how to create the report server/find report server and configure the source path for it.
    regards
    Mani

    You may start digging at...
    http://download-uk.oracle.com/docs/cd/B14099_17/bi.1012/b14048/toc.htm

  • Running script chrome://browser/content/tabbrowser.xml:3003

    I have a running script, chrome://browser/content/tabbrowser.xml:3003
    How do I stop this?

    It is possible that there is a problem with the files sessionstore.js and sessionstore.bak in the Firefox Profile Folder.
    Delete the files sessionstore.js [2] and sessionstore.bak in the Firefox Profile Folder.
    * Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    * http://kb.mozillazine.org/Profile_folder_-_Firefox
    If you see files sessionstore-##.js with a number in the left part of the name like sessionstore-1.js then delete those as well.<br />
    Deleting sessionstore.js will cause App Tabs and Tab Groups and open and closed (undo) tabs to get lost, so you will have to create them again (make a note or bookmark them).
    See also:
    * [1] http://kb.mozillazine.org/Session_Restore
    * [2] http://kb.mozillazine.org/sessionstore.js

  • Applet not running in local browser

    I can run any applet from web.
    I can run any applet in appletviewer.
    But I can not run applets in browser from local html file.
    I can not run even the demos that came with de SDK 1.4.1_01.
    Can anyone give me some hint?
    Maybe is very obvious but I ca not see it.
    Thank you very much.
    Valeriu Sprintu

    the hello.java file is:
    import java.applet.Applet;
    import java.awt.Graphics;
    public class hello extends Applet {
    StringBuffer buffer;
         public void init() {
         public void start() {
         public void stop() {
         public void destroy() {
         public void paint(Graphics g) {
              //Draw a Rectangle around the applet's display area.
              g.drawRect(0, 0, size().width - 1, size().height - 1);
              //Draw the current string inside the rectangle.
              g.drawString("Hello", 5, 15);
    The hello.html file is:
    <html>
    <body>
    Applet should be there
    <br>
    <applet code="hello.class" width=200 height=200>
    No applet
    </applet>
    </body>
    </html>
    hello.html and hello.class are of course in the same folder.
    If I modify the .html file acording to OBJECT tag specifications for Java Plug-In the same applet runs OK in the browser (IE5.0 ).
    I forgot to tell that I have installed the last version of SDK j2sdk1.4.1_01
    <html>
    <body>
    Applet should be there
    <br>
    <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    WIDTH = 200 HEIGHT = 200 >
    <PARAM NAME = CODE VALUE = "hello.class" >
    <PARAM NAME="type" VALUE="application/x-java-applet;version=1.1">
    No applet
    </OBJECT>
    </body>
    </html>
    I think there is a problem with the JVM from Microsoft
    Thank you,
    Best regards,
    ValeriuS

  • NoClassDefFoundError:javax/swing/JApplet  while running japplet in browser

    hai to all,
    i am trying to run a Japplet in broser,
    it's getting NoClassDefFoundError:javax/swing/JApplet
    on statusbar.
    any plugin's are requitred to run swing applets in browser.?please give me details.
    my JApplet is working in Applet viewer.
    i am using Jdk1.3.1, and Applets are also running in my browser(both IE and NetScape).
    thank you in advance
    please mail me to [email protected]
    by
    sambareddy

    I had the same problem when I was developing a swing applet to run on the web. What you have to do is convert your HTML file. It takes out the APPLET tags and replaces them with OBJECT and EMBED tags. This worked for me. I downloaded the converter from the Java site but I cannot recall exactly where. I think if you search for converter you should be able to find it. The newly converted HTML file will also prompt the user to download the correct plug-in if it is not already installed on their machine.
    In the mean time, try using the HTML code below. You will have to change some of the lines but it should work for you. The OBJECT tag is used for IE and the EMBED tag is used for Netscape so don't forget to change both. One wierd thing you will see is that is if you run appletviewer on the converted HTML file, two windows will pop up and one of them will have errors and not load but one will. Don't worry about that, when you run it through the web server, everything works fine.
    Good luck.
    <HTML>
    <HEAD>
    <TITLE>Your title</TITLE>
    </HEAD>
    <BODY>
    <CENTER>
    <!--"CONVERTED_APPLET"-->
    <!-- HTML CONVERTER -->
    <OBJECT classid="clsid:E19F9330-3110-11d4-991C-005004D3B3DB"
    WIDTH = 550 HEIGHT = 300 codebase="http://java.sun.com/products/plugin/1.3.0_01/jinstall-130_01-win32.cab#Version=1,3,0,1">
    <PARAM NAME = CODE VALUE = "the name of your class file" >
    <PARAM NAME = CODEBASE VALUE = "location of the class or jar file">
    <PARAM NAME = ARCHIVE VALUE = "name of your jar file, omit this entire line if you do not have a jar file" >
    <PARAM NAME="type" VALUE="application/x-java-applet;jpi-version=1.3.0_01">
    <PARAM NAME="scriptable" VALUE="false">
    <COMMENT>
    <EMBED WIDTH = 550 HEIGHT = 300 type="application/x-java-applet;jpi-version=1.3.0_01" CODE = "name of your class file" CODEBASE = "location of the class or jar file" ARCHIVE = "name of your jar file, omit this entire arg if you do not have a jar file" scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3.0_01/plugin-install.html">
    </EMBED>
    </CENTER>
    </COMMENT>
    </OBJECT>
    <!--
    <APPLET CODE = "name of your class file" ARCHIVE = "name of jar file if you have one" WIDTH = 700 HEIGHT = 400>
    </CENTER>
    </APPLET>
    -->
    <!--"END_CONVERTED_APPLET"-->

Maybe you are looking for

  • How could i Integrate (merge) 2 different Controlling areas into one?

    Hello gurus, The client i am working for had defined, from the beggining (during SAP Implementation), one Controlling area for the entire company. This definition was correctly done, as a way to centralize every operation and transaccion made. After

  • Download ABAP Objects

    Hi, Is there a way to download dialog programs together with screen definitions same way one would do for a normal report program. I also would like to download table definitions. Scenario We have written some custom applications that we use for demo

  • Kernell security check failure issue

    Hi.  I installed a webcam with mic integrated (external device) to my lenovo T61 computer, running 8.1 windows. When trying to use the webcam, the kernel security check failure appears, crashes my computer and restarts it. What can I do?  Thanks

  • Delta on BSEG-ZUONR

    Hi All, SAP offers the field BSEG-ZUONR in the extractor 0FI_GL_4. However the delta-mechanism does not work for this field. Am I doing something wroin? Is this a bug and has anyone experience with this? Or a workaround? Any help is appreciated. Rega

  • Setting value in a cookie using ABAP code

    Hai All, Using ABAP code is it possible to set some value in a cookie. Regards, H.K.Hayath Basha.