So I am really new to juce, so I know this is something really simple that I'm missing, but I can't figure out how to make my label visible.
To add a button, I just do this:
MainContentComponent::MainContentComponent() { setSize(300, 300); button1 = new TextButton("Button 1"); button1->setBounds(20, 70, 260, 20); addAndMakeVisible(button1); } void MainContentComponent::paint (Graphics& g) { g.fillAll (Colour (0xffffffff)); addAndMakeVisible(button1); }
This works great, but when I do the exact same thing with a label, it doesn't work.
MainContentComponent::MainContentComponent() { setSize (300, 300); label1 = new Label("I am a label. "); label1 ->setBounds(10, 10, 150, 20); label1->setFont(Font(16.0)); addAndMakeVisible(label1); } void MainContentComponent::paint (Graphics& g) { g.fillAll (Colour (0xffffffff)); addAndMakeVisible(label1); }
What am I missing?