Problem resize components >> 2 <<

Hi all again

As I wrote at http://forum.java.sun.com/thread.jspa?threadID=759087

I need a resizable JPANEL with sub-jpanels inside. Every subpanel may content an image or text.

The problem is that I need ( if resize the principal panel ) to get the principal panel and subpanels in exact scale ( it means, margins, relative positions and image / text scale. )

This is a graphical idea that i need:

__

| |

|_|

| || | __

| |I MM MM GGGG | | | _ |

| |I M M M G| | | || |

| |I MM G GG | | | | I M G | |

| |I MM GGGG | |\| |_| |

| |_| |\| _ |

| | resize \ | || |

|_|0.5X/ | | I M G | |

| || |/| |_| |

| |I MM MM GGGG | |/|__|

| |I M M M G| |

| |I MM G GG | |

| |I MM GGGG | |

| |_| |

| |

|_|

The problem was solved by 74philip, but just in a half...

Its important this time , that the code is a independent jPanel class. ( i'm getting problems with preinitialize size of theBufferedImage originalImage object ) . I need use this clase creating another independent class ( jPanel or jFrame) to call this one.

Subpanels' number and its distribution will change dynamically.

And, themost important, I need, plus, to keep the events ( and propierties in general ) lauched by the subpanels, images & texts contained one time resized them...

Can anyone help please ?

PD: Sorry again if I make any English mistakes :)

[1511 byte] By [D4nt3_a] at [2007-10-3 2:55:25]
# 1
I have an easy solution... i hope it works...Draw all the real size images to a virtual BufferedImage. That is, to a BufferedImage that you do not display. Then simply scale that BufferedImage to the JPanel/JFrame dimensions and use drawImage(img,0,0,null)
kkaaakaaa at 2007-7-14 20:44:31 > top of Java-index,Security,Cryptography...
# 2
I want to keep the panel propierties and events, I think they will be lost their propierties if treated like an image.Thanks anyway ;^)
D4nt3_a at 2007-7-14 20:44:31 > top of Java-index,Security,Cryptography...
# 3
it can't be done ? ... :` (
D4nt3_a at 2007-7-14 20:44:31 > top of Java-index,Security,Cryptography...
# 4
This seems to be layout manager issue and i think this is just wroong place to ask. Yuo should probably try Swing forum http://forum.java.sun.com/forum.jspa?forumID=57p.s. it should not be hard at all but i am too lazy to try it now :)
neigora at 2007-7-14 20:44:31 > top of Java-index,Security,Cryptography...
# 5
Hi,It can't be done with a flow layout. I need to put Dynamically some elements, in alleatory x,y positions.I'm trying doing it with null panel and re-calculating the position and size with the scale of components.Thanks anyway :)
D4nt3_a at 2007-7-14 20:44:31 > top of Java-index,Security,Cryptography...