Re: Thinlet GUI toolkit question



"Sundar The Great" <sundar22in@xxxxxxxxx> wrote in
news:1146115764.983821.109430@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:

<snip>
Now i have one more question. Since iam using Thinlet GUI tool kit, im
unable to load an image at the background of the applet. My question is
how to add an image at the background of the applet and also how to add
an image anywhere we want?

I am no Thinlet expert, but...

Thinlet extends Container which extends Component (which
extends Object).
Applet extends Panel which extends Container which extends Component (which
extends Object).

In AWT, you can either:
1) Define a custom Component that draws an image, and add it to a Container
(which could be and Applet or anything else that inherits from Container),
OR
2) In your applet, override the method paint(Graphics g) to draw an image.
The image should be initialized elsewhere (say, during applet
initialization), and copied (say, with drawImage) when paint is called.
Don't neglect to call super(g) to ensure that the overriden paint method also
gets a chance to do its work.

This is basic stuff for AWT. Perhaps Thinlet provides an easier way, but i
don't know what it is.


--
Ian Shef 805/F6 * These are my personal opinions
Raytheon Company * and not those of my employer.
PO Box 11337 *
Tucson, AZ 85734-1337 *
.



Relevant Pages

  • Mouse listener in Swing Japplet
    ... I had a little demo standalone applet with a working mouse listener. ... public class myApplet13 extends Applet implements MouseListener { ... which defines a top tabbed pane and a bottom text area ...
    (comp.lang.java.programmer)
  • RE: how to instantiate the inner class.
    ... Instant VB: C# to VB.NET Converter ... > extends from Frame. ... The class which I inherited from the Frame class becomes ... > the inner class of the class extended from the Applet. ...
    (microsoft.public.dotnet.vjsharp)
  • Re: calling action function of the inner class in main function
    ... I have created the two classes one extends from Applet, ... The class which I inherited from the Frame class becomes ... call the functions of the class extended from Frame class - MenuBarFrame ...
    (microsoft.public.dotnet.vjsharp)
  • calling functions of the inner class- parameters of action functio
    ... I have created the two classes one extends from Applet, ... The class which I inherited from the Frame class becomes ... call the functions of the class extended from Frame class - MenuBarFrame ...
    (microsoft.public.dotnet.vjsharp)
  • KeyListener kinda deaf (in simple game)
    ... extends Container and contains Lettervak's ... Speelveld: ... So I though I'd add a KeyListener to the Applet itself. ... public void keyTyped(KeyEvent e) { ...
    (comp.lang.java.help)