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.

  1. extend jcomponent instead , custom drawing there.
  2. create jpanel contains needed swing components including component earlier step.
  3. add panel applet using default paint method.

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -