Hi Yosi I don't know if I'm pretty smart.
I had the opportunity to work with different GUI systems (starting with the Windows 3.0 SDK!), each of them with its advantages and problems.
The first Java GUI System was AWT and it is still there, but it is rather poor.
Swing is build on the top of AWT, it represents a huge package (in terms of consumed resources) and it was created to solve different problems: -- In early days there was no RAD tool for building GUI screens - the programmer had to code everything, then test, then fix and so on -- Screens are different from a platform to another (from WIndows to Linux, from Windows XP to Vista, depending on the screen settings, from Ubuntu Gnome to Fedora KDE ...)
The answer was the Layout Managers. Instead of positioning the objects on the screen at precise position, all the programmer has to do is to add the objects to the Layout Manager. Then the Layout Manager positions them to the screen so that to properly fit the current characteristics of the user interface.
Typically, one uses a BorderLayout to add header and footer to his/her screen, then adds a panel in the center. In the panel he/she puts a vertical GridLayout to align controls on several lines, then panels for each line with horizontal GridLayout for adding the controls. In this way a typical "enter data" resizable screen can be done only by code, without much tests and errors and the screen can run on most graphic platforms.
There is also a GridBagLayout that avoid defining several vertical/horizontal Grid Layouts. It works like a HTML table in which you can fusion adjacent cells and pout more than one item in a cell (including spaces).
The next generation of LayoutManagers was developed as an Open Source project "Matisse". It allows to put object anywhere on the screen (no longer in predefined cases) and to anchor objects to the panel edges or to other objects. It is rather difficult to code it by hand, but it allows to do a very good job in a productive way if you use a RAD tool. There is a good RAD tool for the "FreehandLayout" (I think it is its name) in NetBeans.
Hope it helps Mihai Le 30/09/2010 14:53, Yosi Pramajaya a écrit :
------------------------------------------------------------------------ I think that you're pretty smart in JAVA. Do you know about SWING? Can you tell me about the Layout Manager? I still confusing about it... If just, text based application, it's easy for me. Thanks..**
-- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en
