View Single Post
Old 01-16-2013, 07:58 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,645
Thanks: 4
Thanked 2,450 Times in 2,419 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Right here: sc = wi.getScaledInstance(puzpiece.getWidth()/3,puzpiece.getHeight()/3, Image.SCALE_AREA_AVERAGING);. The problem itself is quite simple: the Panel does not yet have a size since the frame has not been packed and is not yet visible.
I'm not sure what the best way to do this would be, but what would probably work is to hook an ancestor listener into the panel. This way it'll trigger an ancestorMoved event immediately upon displaying the frame. You should then be able to do what you want to do with the images, and then repaint the panel again.
Yeah that should work methinks.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote