This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
i'm reading book How to Program Java 9th deitel. And i'm just after introduction to gui.
And one of the tasks is to create gui without any functionality, i've attached the jpg of a gui.
But i'm not sure what LayoutManagers i ment to use. Cause its meant to be a simple task.
If you could point me to the right direction. Thanks
aidas kar
Greenhorn
Joined: Mar 08, 2013
Posts: 4
posted
0
aidas kar wrote:Hello
i'm reading book How to Program Java 9th deitel. And i'm just after introduction to gui.
And one of the tasks is to create gui without any functionality, i've attached the jpg of a gui.
But i'm not sure what LayoutManagers i ment to use. Cause its meant to be a simple task.
If you could point me to the right direction. Thanks
Joanne Neal
Rancher
Joined: Aug 05, 2005
Posts: 3011
9
posted
0
aidas kar wrote:But i'm not sure what LayoutManagers i ment to use.
Why don't you try experimenting with different layout managers and see what results you get. Far more interesting and you'll learn a lot more
Joanne
aidas kar
Greenhorn
Joined: Mar 08, 2013
Posts: 4
posted
0
I did. No luck though. Book covered flowlayout, boarderlayout and gridlayout. And boxlayout only one method gethorizontalbox.
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32689
4
posted
0
Welcome to the Ranch You do realise you can use several layouts simultaneously? You can have for example, a top panel, a middle panel and a bottom panel, which sounds like border layout. You can put grid layout on one panel and box on the other two. Just an example. You should find more details as you go through that tutorial. Remember: in grid layout you usually get all the components the same size.
They should be listed here, at least the more commonly‑used ones are. Flow layout is no good, and nobody can understand Spring layout.
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32689
4
posted
0
By the way: I think this discussion would fit better in our GUIs forum, so I shall move it.
aidas kar wrote:I did. No luck though. Book covered flowlayout, boarderlayout and gridlayout. And boxlayout only one method gethorizontalbox.
There is no one way to do this, there are many options. The key point to remember is that you can use multiple layouts, so you don't have to find just one that makes the entire layout. Take each portion of the GUI and think what layouts would be best to make that portion. Once you have them designed individually, then choose which layout(s) would be best to put the individual items together.
Steve
aidas kar
Greenhorn
Joined: Mar 08, 2013
Posts: 4
posted
0
Thanks. I didn't realize I should add empty panels to center components. I thought there's some way to lay them out using managers.
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32689
4
posted
0
aidas kar wrote: . . . I thought there's some way to lay them out using managers.
You can with the “complicated” layouts like gridbag, or you can use several “simple” layouts like grid in different components in different parts of your display.