This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Applets and the fly likes Reg: Running Swing in Browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Reg: Running Swing in Browser" Watch "Reg: Running Swing in Browser" New topic
Author

Reg: Running Swing in Browser

adeeb alexander
Ranch Hand

Joined: May 29, 2008
Posts: 268
hi,
i have a swing application. I wanted to run it in a browser i have firefox. i have the following import statements in my java code. I have only used the swing components in the application.


and the code of html file generated by the html converter is.



i have also installed j2see sdk ver 1.4. but my browser still shows an dialogue displaying unknownplugin (application/x-java-applet;jpi-version=1.3.0_01).

please any body help me regarding this issue

Thanks and Regards in Advance
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 9990
    
    7

Moving to a more appropriate forum.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39530
    
  27
I recommend using an APPLET tag, not EMBED or OBJECT. Those introduce a number of complications without offering commensurate benefits.


Ping & DNS - updated with new look and Ping home screen widget
adeeb alexander
Ranch Hand

Joined: May 29, 2008
Posts: 268
ok when i used the applet tag in this way


i am able to see just a plain box and a cross mark at the top
when i checked the java console i can see this

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39530
    
  27
What is "ButtonDemo"? Does it extend Applet or JApplet? In the code you posted earlier the applet class was named "login".
adeeb alexander
Ranch Hand

Joined: May 29, 2008
Posts: 268
Actually the login is the slightly complex application. So i was experimenting on the simple ButtonDemo class. But this ButtonDemo already extends JPanel.
Here's the code
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39530
    
  27
In that case you could write a little wrapper class that extends JApplet, and to the content pane of which you'd add the ButtonDemo object.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reg: Running Swing in Browser
 
Similar Threads
applet not showing
Unable to load Applet in Tomcat 5.5.12
Unable to load Applet in Tomcat 5.5.12
Problems when initiating applet for jre1.4.2 when jre1.5 is on the client
Using cab files