Archive for the 'Java - Swing' Category

Quiet often, we come across the same old problem. Few days ago, a collegue of mine also came across this problem. Yes, I am talking about a print preview and print control that is customized to your application’s need. Unless, you are ready to spend some money, it can be hard to write a complete [...]


By default, JLabel supports only single line text. However JLabel has capability to parse through simple HTML. We can make use of this feature to display multitline text in a single JLabel.
Following shows a sample for this simple method.
JLabel multiLineLabel = new JLabel( “<html><body>Line 1<br>Line 2<br>Line 3</body></html>”);
Other Links:
http://blog.codebeach.com/2008/02/using-html-in-java-swing-controls.html