Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Adding components to a JPanel  RSS feed

 
John Pisci
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks,

I'm building a form and I want to add a number of different components to a JPanel.

At the moment, the only way I can do this is by using the following code:


However, I've tried using the following code and it doesn't work.


The reason being that I want to be able to play around with the font size/ colour of the label.

Am I going about this the right way? If so, where am I going wrong and if not, how do I do it?

Thanks in advance!
 
John Pisci
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ignore this- I was being stupid!

The following works:

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!