java - Using swing components with an applets paint method -
i have functioning java applet can embedded web page , wish add swing components additional functions. whenever add component jlabel, not appear on viewport/canvas unless remove entire paint method. latter option allows me add swing components naturally cannot render shapes. appears resemble exclusive or (xor), either 1 not other.
is there anyway in native java applet add swing components , still maintain paint(graphics g) method. please note inheriting applet , not japplet.
if override paint method in applet there no simple way.
what instead of overriding paint in applet.
- extend jcomponent instead , custom drawing there.
- create jpanel contains needed swing components including component earlier step.
- add panel applet using default paint method.
Comments
Post a Comment