Hi there !
It's been a long time since I hadn't posted here, but here I am with a new question :D
I have a JFrame which supposedly contains a map editor. No problem about that though, it's just that I would like to have two JPanels as components of my frame's ContentPane. One to have the actual map (in working progress) and another one to have all the different tiles, options, etc. But, as my map is always square-shaped, I would like to have one of these JPanels to always be a square. Something looking like this :
http://img11.hostingpics.net/pics/178590schema.png
The code for this would be something like :
optionPanel.setBounds(0,0,frame.getWidth()-frame.getHeight(),frame.getHeight());
mapPanel.setBounds(frame.getWidth()-frame.getHeight(),0,frame.getWidth()-frame.getHeight(),frame.getHeight());
I tried using this piece of code but it seems like it won't update when I resize the frame. I also tried using a GridBagLayout but I don't seem to find how to do such a thing. There must be something incredibly simple I haven't thought of, but isn't it the aim of this newbie section to help those like me ? ;D
Anyway, thanks a lot to anyone answering me :)
J0