# Using past version of JUCE code and past LookAndFeel

**URL:** <https://forum.juce.com/t/using-past-version-of-juce-code-and-past-lookandfeel/24043>\
**Category:** The Projucer\
**Created:** [September 4, 2017, 3:05pm UTC](https://forum.juce.com/t/using-past-version-of-juce-code-and-past-lookandfeel/24043 "2017-09-04T15:05:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeffersonBledsoe](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@JeffersonBledsoe](https://forum.juce.com/u/JeffersonBledsoe)\
**Post date:** [September 4, 2017, 3:05pm UTC](https://forum.juce.com/t/using-past-version-of-juce-code-and-past-lookandfeel/24043/1 "2017-09-04T15:05:40Z")

</div>

I’ve taken on a project where JUCE 4.3 is used rather than JUCE 5. Building this project causes the GUI to not appear how the user wants as it builds with the new LookAndFeels of JUCE 5. Setting the look and feel to LookAndFeel\_V3 gets it pretty close, however there are still a few areas where there are differences (namely editable Labels appear black). Is it possible to obtain the old LookAndFeel classes to replicate their build?

---

<div class="post-metadata">

**Author:** ![IvanC](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ivanc/32/685_2.png) [@IvanC](https://forum.juce.com/u/IvanC)\
**Post date:** [September 4, 2017, 3:33pm UTC](https://forum.juce.com/t/using-past-version-of-juce-code-and-past-lookandfeel/24043/2 "2017-09-04T15:33:12Z")

</div>

Declare this in your main class header :  
`LookAndFeel_V3 theOldLF;`

And in the constructor of that class :  
`LookAndFeel::setDefaultLookAndFeel(&theOldLF);`

It should do the trick (I do that all the time when I update to JUCE 5 my projects)

---

<div class="post-metadata">

**Author:** ![JeffersonBledsoe](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@JeffersonBledsoe](https://forum.juce.com/u/JeffersonBledsoe)\
**Post date:** [September 4, 2017, 4:40pm UTC](https://forum.juce.com/t/using-past-version-of-juce-code-and-past-lookandfeel/24043/3 "2017-09-04T16:40:58Z")

</div>

That is what I’m currently using to attempt to have the JUCE 5 UI, however it still gives the text labels white text, or a black background when selecting (as shown by the left screenshots below - Right is what it should look like).

![Screen Shot 2](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/d/d1900b519ef276cf966b102e87ab49afee2f6e65.png) ![Screen Shot 3](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/3/3ce6a1e7a4b5f2553ad47f0aa856029826d72f7b.png)

---

<div class="post-metadata">

**Author:** ![IvanC](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ivanc/32/685_2.png) [@IvanC](https://forum.juce.com/u/IvanC)\
**Post date:** [September 4, 2017, 4:57pm UTC](https://forum.juce.com/t/using-past-version-of-juce-code-and-past-lookandfeel/24043/4 "2017-09-04T16:57:02Z")

</div>

Are you sure that you don’t call the constructor of that label before you do the setDefaultLookAndFeel call ? My trick works only if your labels are created with the new operator **after** the setDefaultLookAndFeel, with them declared as pointers or ScopedPointers. If not, you can still set manually the LookAndFeel of each component to “theOldLF”

---

<div class="post-metadata">

**Author:** ![JeffersonBledsoe](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@JeffersonBledsoe](https://forum.juce.com/u/JeffersonBledsoe)\
**Post date:** [September 4, 2017, 8:04pm UTC](https://forum.juce.com/t/using-past-version-of-juce-code-and-past-lookandfeel/24043/5 "2017-09-04T20:04:54Z")

</div>

I’m calling the setDefaultLookAndFeel at the top of the MainContentComponent constructor, before anything else happens in the MainContent class. Turns out they aren’t labels which are being incorrectly drawn (my bad), they are sliders with a sliderStyle of incDecButtons, does this change anything?

---

<div class="post-metadata">

**Author:** ![t0m](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/t0m/32/16413_2.png) [@t0m](https://forum.juce.com/u/t0m)\
**Post date:** [September 5, 2017, 6:58am UTC](https://forum.juce.com/t/using-past-version-of-juce-code-and-past-lookandfeel/24043/6 "2017-09-05T06:58:37Z")

</div>

Are your sliders member variables? If so, they will be constructed before the MainContentComponent constructor…

You could call `LookAndFeel::setDefaultLookAndFeel(&theOldLF);` in your main function instead, or, if you want to keep it in your `MainContentComponent` class for some reason, you could do something like this:

```
LookAndFeel_V3 theOldLF;

struct LookAndFeelLoader
{
    LookAndFeelLoader() { LookAndFeel::setDefaultLookAndFeel (&theOldLF); }
};

LookAndFeelLoader lAndFLoader;

// Your other member variables go here.
Slider s1, s2;
```
