In an application, I\'m using uneditable JEditorPanes as a sort of a generic UI widget that can display somewhat complex content (HTML will do the trick), wrap text lines an
// JPanel panel = new JPanel(); ScrollablePanel panel = new ScrollablePanel(); panel.setScrollableWidth( ScrollablePanel.ScrollableSizeHint.FIT );
See Scrollable Panel for the class and an explanation on how the class works.