I have created a JLabel
and draw a long String
on it. But, the problem is, however long is the content, the content always display at the middle of the label's box! I want to push the text to the top of the box.
How can I fix it? Thank you so much!
Font times = new Font("Times New Roman", Font.CENTER_BASELINE, 13);
JLabel mess = new JLabel();
mess.setFont(times);
mess.setLocation(300, 125);
mess.setSize(250, 200);
mess.setText(message);
mess.setForeground(Color.WHITE);
getContentPane().add(mess);