hi
what would you say are the best and the worst layout managers i need to use some for my project, but i only know of
GridLayout
FlowLayout
BorderLayout
and they don't seem to do quite what i want
Cheers
Printable View
hi
what would you say are the best and the worst layout managers i need to use some for my project, but i only know of
GridLayout
FlowLayout
BorderLayout
and they don't seem to do quite what i want
Cheers
CardLayout is cool but i haven't had
a need for it yet. The most flexible
layout manager seems to be the
GridbagLayout but the most complex.
I like just setting the LayoutManager to
null and use absoulte positioning, but
i heard that isn't a good idea because of
cross platform issues.
yeah we aren't allowed to use absolute posistioning for that reason, how many layout managers are there ?Quote:
Originally posted by Dilenger4
CardLayout is cool but i haven't had
a need for it yet. The most flexible
layout manager seems to be the
GridbagLayout but the most complex.
I like just setting the LayoutManager to
null and use absoulte positioning, but
i heard that isn't a good idea because of
cross platform issues.
BorderLayout
BoxLayout
CardLayout
FlowLayout
GridBagLayout
GridLayout
and the new...
SpringLayout
i haven't got JDK 1.4 yet and i am assuming that SpringLayout is in it, so what does that one do it sounds interesting
Some aren't aware of this, but you can combine layout managers. For example, you could set up a BorderLayout, then in Center, you could put a text box, then in the South, you could put a FlowLayout and place buttons in that.
Also, I haven't worked with it, but I hear that the IDE's do a good job of juggling the layout managers for you--you focus on the physical design and the IDE will build the requisite code for you. Good IDE's use FlowBagLayout with all of it's nuances and complexities.
cudabean
Quote:
Posted by Cudabean
Some aren't aware of this, but you can
combine layout managers. For example,
you could set up a BorderLayout, then
in Center, you could put a text box, then
in the South, you could put a FlowLayout
and place buttons in that.
Providing you use panels and set
the layout managers accordingly. :)
quite a few people are aware on our course that you can put layout managers within others, but we aren't allowed to used IDEs to manage ours, this may seem harder but in the long term it will benefit us because we will be able to do them without an IDE and anyone can use an IDE really :)Quote:
Originally posted by Cudabean
Some aren't aware of this, but you can combine layout managers. For example, you could set up a BorderLayout, then in Center, you could put a text box, then in the South, you could put a FlowLayout and place buttons in that.
Also, I haven't worked with it, but I hear that the IDE's do a good job of juggling the layout managers for you--you focus on the physical design and the IDE will build the requisite code for you. Good IDE's use FlowBagLayout with all of it's nuances and complexities.
cudabean
Haven't had a chance to play with it yet but there is a sun tutorial on it if you want to look into it.Quote:
Originally posted by zmerlinz
SpringLayout, what does that one do
its here http://java.sun.com/docs/books/tutor...ut/spring.html
a brief snippet that could be useful
Quote:
Spring layouts do their job by defining relationships between the edges of components. For example, you might define that the left edge of one component is a fixed distance (5 pixels, say) from the right edge of another component. By default, a spring layout defines the width and height of a component (the distance between its left and right edges and between its top and bottom edges) to be somewhere between the component's minimum and maximum sizes -- if possible, at its preferred size.
I'm using BoxLayout; it's what Mark advised to use for the project
i had a look at boxlayout last night as i thought i could of used it in my work, but in the end it proved to be more hassle than it was worth, so i just stuck with gridlayout.
BTW my project is finished now :)
Yeah BoxLayout is a bit of a pain, but I managed to get it working (grid layout would have been quicker though) :)
Yay you on getting the project done :) :) :)
I've got all the code done now after nearly killing myself late last night and most of today. I'm gonna do testing this evening and hand in what I can on Friday, and then hand in the rest on Tuesday
yeah 2 the munkeh!
Sometimes the most complex of layout managers are the most powerful, ie GridBagLayout is probably by far the best I have used, but it is worth the additional learning involved.
Sun's java tutorials are probably a great way to learn them, after that it's good old Mr Horton!!! :p
:) :( :o :p ;) :D :cool: :rolleyes: :mad: :confused: :eek:
Thanks :) I think Elmo is very cool btw
But Mr Horton is very scary (that picture on the front of his book is anyway :p)
Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh Munkeh
Anyway...... Did Mark ever tell you if he was going to do any GridBagLayout with you? I doubt he will, but you never know
Don't think he will, he hasn't mentioned it