Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet wont load...

 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator





after i use the <applet></applet> tags in html this applet wont display
the circles and SHA..

why not?


Thanks,

Justin

p.s i have a CircleListener as you can see, but its commented out cause it creates a second class. in the applet code, how do i set the code value equal to more than one class file?
 
Adam Nace
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like it ought to display something. Are you sure its the applet thats the problem, or is it possible that the applet isn't loading at all.

i.e., is the button being displayed?

- Adam
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well i have another applet that is just a big JScrollPane, and that displays. But this one won't, im stuck.

Justin Fox
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the paint method being called?
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you dont have to call it in the init() do you? i never do in any other applications...


Justin Fox
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, your code doesn't have to call it, because someone does, and that's not going to happen when using Swing (as JApplet does). Swing wants you to use the paintComponent method instead. Have your previous applets possibly all been based on Applet (as opposed to JApplet)?
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
umm it works now, i updated my java plugin stuff for my browser.
but i have to use paint() in JApplet, it doesnt recognize paintComponent when you're using JApplet, only if you use JPanel.

Justin
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic