java - How to show JLabel ellipsis in MigLayout? -


using default layout manager, jlabel shows ellipsis when frame resized.

as illustrated by:

public static void main(string[] args) {     final jframe jframe = new jframe("jlabel, show me ellipsis!");      jframe.getcontentpane().add(new jlabel("sure darling! shrink me , i'll show you"));      jframe.pack();     jframe.setvisible(true); } 

however, miglayout not display such behaviour!

public static void main(string[] args) {     final jframe jframe = new jframe("jlabel, show me ellipsis!");      jframe.getcontentpane().setlayout(new miglayout());     jframe.getcontentpane().add(new jlabel("nope! not know enough!"));      jframe.pack();     jframe.setvisible(true); } 

i tried layout/component constraint think of. know if such thing possible in mig?

a jlabel has minimum size (or exactly, don't remember) same preferred size. miglayout shrinks component down min. have add component constraint allows sizing smaller minsize:

content.add(label, "wmin 10lp"); 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -