• Post Reply Bookmark Topic Watch Topic
  • New Topic

Left aligning a JLabel  RSS feed

 
Paul Keohan
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I make sure a JLabel always starts at the left edge of a JPanel? Using a BorderLayout for the panel doesn't seem to help. I'd imagine this must be fairly simple to do but I'm stumped.
Thanks.
Paul
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried FlowLayout.LEFT or maybe GridBagLayout.
setLayout(new FlowLayout(FlowLayout.LEFT));
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!