# TabbedComponent fix

**URL:** <https://forum.juce.com/t/tabbedcomponent-fix/8404>\
**Category:** General JUCE discussion\
**Created:** [April 2, 2012, 10:46am UTC](https://forum.juce.com/t/tabbedcomponent-fix/8404 "2012-04-02T10:46:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [April 2, 2012, 10:46am UTC](https://forum.juce.com/t/tabbedcomponent-fix/8404/1 "2012-04-02T10:46:33Z")

</div>

When a new tab is added to TabbedComponent, the contentComponent might never be resized(), when the size of TabbedComponent isn’t changed (after).

Fix:  
just add resized() at the end of the addTab()-Method.

[code]void TabbedComponent::addTab (const String& tabName,  
const Colour& tabBackgroundColour,  
Component\* const contentComponent,  
const bool deleteComponentWhenNotNeeded,  
const int insertIndex)  
{  
contentComponents.insert (insertIndex, WeakReference (contentComponent));

```
if (deleteComponentWhenNotNeeded && contentComponent != nullptr)
    contentComponent->getProperties().set (TabbedComponentHelpers::deleteComponentId, true);

tabs->addTab (tabName, tabBackgroundColour, insertIndex);

resized(); // <------- new	

```

}[/code]

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [April 2, 2012, 11:47am UTC](https://forum.juce.com/t/tabbedcomponent-fix/8404/2 "2012-04-02T11:47:55Z")

</div>

Ok, thanks!

---

<div class="post-metadata">

**Author:** ![fireplayer](https://avatars.discourse-cdn.com/v4/letter/f/48db29/32.png) [@fireplayer](https://forum.juce.com/u/fireplayer)\
**Post date:** [April 6, 2012, 6:57am UTC](https://forum.juce.com/t/tabbedcomponent-fix/8404/3 "2012-04-06T06:57:43Z")

</div>

On the TabbedComponent subject, how can I get rid of the grey line between the tabs and the component area. I tried overriding the paint routine, but the line still gets drawn.

Also I could not set the text color for the tabs. Nothing worked other than drawing the text myself. Am I missing something?
