Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reg: Running Swing in Browser

 
adeeb alexander
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11027
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to a more appropriate forum.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I recommend using an APPLET tag, not EMBED or OBJECT. Those introduce a number of complications without offering commensurate benefits.
 
adeeb alexander
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic