Results 1 to 16 of 16

Thread: layout managers

  1. #1

    Thread Starter
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604

    layout managers

    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

    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

    [Galahtech.com] | [My Site] | [Fishsponge] | [UnixForum.co.uk]

  2. #2
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    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.

  3. #3

    Thread Starter
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604
    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.
    yeah we aren't allowed to use absolute posistioning for that reason, how many layout managers are there ?

    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

    [Galahtech.com] | [My Site] | [Fishsponge] | [UnixForum.co.uk]

  4. #4
    Addicted Member Mrs Kensington's Avatar
    Join Date
    Sep 2001
    Location
    Dorset, UK
    Posts
    144
    BorderLayout
    BoxLayout
    CardLayout
    FlowLayout
    GridBagLayout
    GridLayout

    and the new...
    SpringLayout
    Ford? Theres an infinite number of monkeys outside that want to talk to you about a script of hamlet they've produced!

  5. #5

    Thread Starter
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604
    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 people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

    [Galahtech.com] | [My Site] | [Fishsponge] | [UnixForum.co.uk]

  6. #6
    Addicted Member
    Join Date
    Nov 2001
    Location
    Yewston, Texis
    Posts
    240
    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

  7. #7
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    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.

  8. #8

    Thread Starter
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604
    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
    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

    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

    [Galahtech.com] | [My Site] | [Fishsponge] | [UnixForum.co.uk]

  9. #9
    Addicted Member Mrs Kensington's Avatar
    Join Date
    Sep 2001
    Location
    Dorset, UK
    Posts
    144
    Originally posted by zmerlinz
    SpringLayout, what does that one do
    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.
    its here http://java.sun.com/docs/books/tutor...ut/spring.html

    a brief snippet that could be useful

    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.
    Ford? Theres an infinite number of monkeys outside that want to talk to you about a script of hamlet they've produced!

  10. #10
    Hyperactive Member Pix's Avatar
    Join Date
    Feb 2001
    Location
    I'm not telling you (or them)
    Posts
    282
    I'm using BoxLayout; it's what Mark advised to use for the project

  11. #11

    Thread Starter
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604
    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

    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

    [Galahtech.com] | [My Site] | [Fishsponge] | [UnixForum.co.uk]

  12. #12
    Hyperactive Member Pix's Avatar
    Join Date
    Feb 2001
    Location
    I'm not telling you (or them)
    Posts
    282
    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

  13. #13
    Member daveyboy's Avatar
    Join Date
    Feb 2002
    Location
    Aberystwyth, UK
    Posts
    33
    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!!!
























  14. #14
    Hyperactive Member Pix's Avatar
    Join Date
    Feb 2001
    Location
    I'm not telling you (or them)
    Posts
    282
    Thanks I think Elmo is very cool btw

    But Mr Horton is very scary (that picture on the front of his book is anyway )

  15. #15
    Member daveyboy's Avatar
    Join Date
    Feb 2002
    Location
    Aberystwyth, UK
    Posts
    33
    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


    Infinity isn't large it's just incomprehensible

  16. #16
    Hyperactive Member Pix's Avatar
    Join Date
    Feb 2001
    Location
    I'm not telling you (or them)
    Posts
    282
    Don't think he will, he hasn't mentioned it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width