• Post Reply Bookmark Topic Watch Topic
  • New Topic

How do i put a JLabel In One of my JPanel's in this code

 
mitchell cooper
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please How do i put a JLabel In One of my JPanel's in this code i cont work it out?

 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mitchell cooper wrote:please How do i put a JLabel In One of my JPanel's in this code i cont work it out?

Umm the same way you add other components?
 
Campbell Ritchie
Marshal
Posts: 52602
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would of course have some layout information or constraints. If you add all those components without layout details, they will appear on top of one another and only the most recently added will be visible. In the case of a panel, the default layout is flow layout, so components are added sequentially in the flow, so you can get away without layout info.

But I think flow layout is completely useless and avoid it like the plague.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!