• 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
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Rob Spoor
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:

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
 
Evacuate the building! Here, take this tiny ad with you:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic