At 03:30 PM 11/30/2001 -0800, Ken Miller wrote:
 >Ok, I got the tiled image to appear by adding it to the desktop and making
 >the panel size sufficiently large enough.  I set it to 2000,2000 so that it
 >would always take up the entire window even if it's resized to the whole
 >screen.

        You should scale the background image to the size of the JDesktopPane
        in its paint method instead.  There is an overloaded drawImage() that
        helps with this.  Or come up with a simple tiling algorithm
        yourself to use.

 >The problem now is that any JInternalFrame that is placed onto the desktop
 >and moved or later closed, writes over the tiled background.  So I guess I
 >need some way to make sure that the desktop gets repainted whenever any of
 >the JInternalFrames are moved or closed.  Does that mean I have to capture
 >the event of any JInternalFrame and force it to redraw the desktop when it
 >is resized, moved or closed?

        Almost.  Capture the events of the JDesktopPane instead.  Scale the
        image when you resize or open, but don't scale when you just get
        any other repaint requests (rescaling is painfully slow).

        However, if you put a JDesktopPane within your JDesktopPane
        (ie, a JInternalFrame with its own JDesktopPane... with its
        own JInternalFrame's), all kinds of funky things happen.
        I make the reference to my background image
        a static shared by all instances of a JDesktopPane, but repainting (as
        I describe above) is quite weird.  The inner JDesktopPane scales properly
        when I resize it, but when there's internal window "damage", it draws
        the background image at the scale of the outer JDesktopPane.

        Very weird behavior.  I had to disable the ability for inner JDesktopPane's
        to have background images unfortunately.  :(

        Btw, we're building a cool collaborative environment that works over HTTP...
        fun stuff.

        Frank G.
+======================================================================+
| Crossroads Technologies Inc, 55 Broad Street, 28th Fl, NYC, NY 10004 |
|  Enterprise Java Engineering                                         |
| Email: [EMAIL PROTECTED]         Web: www.CrossroadsTech.com |
| Pager: 800-495-6244                   ePager: [EMAIL PROTECTED]     |
| Voice: 212-482-5280 x229                 Fax: 212-482-5281           |
+======================================================================+


_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to