I searched through many posts and figured out that JLabel
supports HTML.
So I can do
JLabel search = new JLabel("<html>Search<br/> By:</html>");
to get multiple lines. Above code will result in
Search
By:
However, What I want is something like
Search
By:
Adding spaces before "By:" will work only when the window is not resizable(And very silly lol). Can anyone tell me how to modify this code to make it work as I wanted?
See Question&Answers more detail:os