I am seeing it differenty than the accepted answer.
1) Should I completely avoid the use of those methods?
Never avoid! They're there to express the size constraints of your components to the layout manager. You can avoid using them if you're not using any layout manager and try to manage the visual layout on your own.
Unfortunately, Swing is not coming with reasonable default dimensions. However, instead of setting the dimensions of a component, it is better OOP to descend your own component with reasonable defaults. (In that case you call setXXX in your descendant class.) Alternatively, you can override the getXXX methods for the same effect.
2) The methods have been defined for a reason. So when should I use them? In which context? For what purposes?
Always. When you create a component, set its realistic min/preferred/max size according to the use of that component. For example, if you have a JTextField for entering country symbols such as UK, its preferred size shall be as wide to fit two chars (with the current font, etc.) but probably it is meaningless to let it grow any bigger. After all, country symbols are two chars.
As opposite, if you have a JTextField for entering e.g. a customer name, it can have a preferred size for like the pixel size for 20 chars, but can grow to bigger if the layout is resized, so set the maximum size to more. At the same time, having a 0px wide JTextField is pointless, so set a realistic minimum size (I would say the pixel size of 2 chars).
3) What exactly are the negative consequences of using those methods?
(I can only think adding portability between systems with different screen resolution).
No negative consequences. These are hints for the layout manager.
4) I don't think any LayoutManager can exactly satisfy all desired layout needs.
Do I really need to implement a new LayoutManager for every little variation on my layout ?
No, definitely not. The usual approach is to cascade different basic layoutmanagers such as horizontal and vertical layout.
For example, the layout below:
<pre>
+--------------+--------+
| ###JTABLE### | [Add] |
| ...data... |[Remove]|
| ...data... | |
| ...data... | |
+--------------+--------+
</pre>
is having two parts. The left and right parts are a horizontal layout. The right part is a JPanel added to the horizontal layout, and this JPanel is having a vertical layout which lays out the buttons vertically.
Of course, this can grow tricky with a real life layout. Therefore grid-based layout managers such as MigLayout are much better if you're about to develop anything serious.
5) If the answer to 4 is "yes", won't this lead to a proliferation of LayoutManager classes which will become difficult to maintain?
No, you definitely shall not develop layout managers, unless you need something very special.
6) In a situation where I need to define proportions...
between children of a Component (eg, child1 should use 10% of space, child2 40% ,child3 50%), is it possible to achieve that without implementing a custom LayoutManager?
Basically, once the preferred sizes are set right, you may not want to do anything in percentage. Simply, because percentages are pointless (e.g. it is pointless to have a JTextField 10% of the window size - since one can shrink the window so that JTextField becomes 0px wide, or can expand the window so that the JTextField is across two displays on a multi-display setup).
But, may times you may use the percentages to control sizes of bigger building blocks of your gui (panels, for example).
You can use JSplitPane where you can pre-set the ratio of the two sides. Or, you can use MigLayout which allows you to set such constraints in percentage, pixels, and other units.
JEditorPane
with HTML that does not itself suggest a width. OTOH I am not sure if I've missed something. I'll carefully review the replies on the thread, but was interested if you had any comments, particularly on the latter case. – Enthetic