This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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
Sheriff
Posts: 55350
157
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!