i've written a game board currently but its minimal. i draw the board and then i've added two labels that i've postiioned off to the right side with setlocation. I dont know that set location will work as i add more controls so i'm looking for a better way.

currently i draw the board with drawing methods in teh area starting at 0,0 to an x dimension of 3/4 the current window width and a y dimension of 4/5 the current window height. the rest of the area should be available for controls like labels and a console window and some type of control i'm going to use for a move list and a scroll bar.

How do i reserve the area for the board and then have the freedom of using some kind of flow layout in the other areas.

I dont know a lot about layouts but i'm willing to learn and was hoping someone can get me started on what sort of layout management i need for this task.

Mike

I figured out how to use a flow manager to allign things ( in the design of my console) and i can set an element to a size sort of with setting a prefered size. In my JFrame can i have 3 panels:

XY
ZY

where x is board, y/y is the long side and z is console underneath, and in the frames paintComponents would that be the appropriate place to set the prefred size of each pane by first getting the width and height?

I can use a layout manager in the frame to set the layout of only teh 3 panes and in each pane set that layout as i wish? Should i capture some sort of onsize event instead of doing it in paint components?

MIke

if i got width and height initially when i first set the layout, and say my width is 500 and my height 500, if i made panel 1 prefered 400 by 400 and panel 2 prefered 100 by 500 and panel 3 prefered 500 by 100, ie. i'm filling all the space, would it hold onto those relative values between the panes on resize?

i was able to divide the board into 3 panes and control the size of the panes with a layout manager and prefered sizes for panes.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.