Hi all,
Anyone written a JLabel (extension/util/??) that automatically abbreviates the contents depending on it's preferred/visible size?
much appreciated.
Hi all,
Anyone written a JLabel (extension/util/??) that automatically abbreviates the contents depending on it's preferred/visible size?
much appreciated.
Doesn't JLabel abbreviate text that can't fit by default?
This code displays only "The quick brown fox jum..." on my install:
public class Driver {
public static void main(String[] args) {
final JFrame frame = new JFrame("JLabel Test");
frame.setSize(160,120);
frame.getContentPane().add(
new JLabel("The quick brown fox jumped over the lazy dog.") );
frame.setVisible(true);
}
}
For improved swing, before writing your own extensions, I recommend to check SwingLabs. In particular there is a cool JXLabel (although it's not clear what you want that the regular JLabel has not)