• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Swing Tutorial Book - layout managers

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Last fall while working on some small class projects I used several different layout managers, but found them somewhat restrictive with respect to what I wanted to do. I noticed in the TOC of the book that you apparently can create customized layout managers. I was unaware of this and was wondering what sort of limitations there might be imposed in creating your own layout manager.
Thanks,
Mike
 
Author
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anyone can write or use any custom layout manager, though sometimes it takes a bit of doing to make it work right. You just need to write a class that implements LayoutManager interface (or, optionally, its subinterface LayoutManager2). This page has more information, along with two examples of custom layout managers:
http://java.sun.com/docs/books/tutorial/uiswing/layout/custom.html
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To give credit to the book, these things are covered. However from experience i have to say that the normal layoutmanagers suffice. Maybe take a look at your design and try to use the standard ones in java. That will be easier maintenance (for others) than creating your own.
 
Michael Cleary
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks all!
While it may be harder to maintain if you write your own, if there are specific things you want to do with the layout, it seems like the only way to go.
Thanks,
Mike
 
Paddy spent all of his days in the O'Furniture back yard with this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic