I managed to load FlatLAF in Installer module (my code shown below)
My app screen shot:   https://snipboard.io/DyuCkl.jpgCompared to FlatLAF in NB 
IDE, note that in my app the tabs are:- shorter in height.- non-selected tab 
"Module2 Window" is VERY DARK.- selected tab has no underline.
For comparison, here is the IDE with FlatLAF:  https://snipboard.io/vpB4Ox.jpg- 
tab heights taller- non-selected tab is only slightly darker than focused tab.- 
Selected tabs have underlines.
I did see in https://search.maven.org/search?q=flatlaf that there exist two 
NB-specific flatlaf jars: org-netbeans-libs-flatlaf-RELEASE140.jar and 
org-netbeans-swing-laf-flatlaf-RELEASE140.jar (don't what to do with these, if 
anything. I assume I shouldn't use them, although when I did add as a wrapped 
jar then the additional tab for 'FlatLAF' appeared in LAF settings, although 
empty)
I have checked NB dev faq and found nothing related to implementing flatlaf on 
NB: https://netbeans.apache.org/wiki/DevFaqIndex.asciidoc
The only meaningful info re flatlaf that I can find is on 
https://www.formdev.com/ so makes me wonder whether my app is just seeing the 
default/raw flatlaf (eg. the dark non-selected tab) and customizations are 
needed. If so, is there a simple process to make my app look like the NB IDE. 
i.e. A properties file to copy from NB somewhere and/or will it involve the 
org-netbeans-*.jar files I mentioned above?Is there any info on this somewhere 
or NB dev help page for using flatlaf I'm not seeing somewhere, please?
==========
import com.formdev.flatlaf.FlatLightLaf;import javax.swing.UIManager;import 
org.openide.modules.ModuleInstall;
public class Installer extends ModuleInstall {
    @Override    public void restored() {    }
    @Override    public void validate() throws IllegalStateException {        
super.validate(); // Generated from 
nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/OverriddenMethodBody      
                  setupLAF();    }
    private void setupLAF(){
        UIManager.installLookAndFeel(new UIManager.LookAndFeelInfo("FlatLaf 
Light", FlatLightLaf.class.getName()));   
        try {            UIManager.setLookAndFeel(new FlatLightLaf());        } 
catch (Exception ex) {            System.err.println("Failed to initialize 
LaF");        }        // NbPreferences.root().node( "laf" ).put( "laf", 
"com.formdev.flatlaf.FlatLightLaf" );                    }    }
    On Sunday, June 26, 2022, 03:09:48 PM GMT+3, Mike Hallan 
<mkhal...@yahoo.com.invalid> wrote:  
 
 Hi, 
I upgraded an existing NB Platform Application (using Ant) to NB 14 and want to 
get the app to use FlatLAF Light as the default on startup. It doesn't and the 
FlatLAF doesn't even appear as an option in the app's LAF combo box.
Even if I create a completely a new Platform Application the FlatLAF does not 
appear in the app's LAF combo box. All I see in the app's 
Tools>Options:Appearance>Look and Feel combo box is: Metal, Nimbus, CDE/Motif, 
Windows (default) and Windows Classic. Whereas in the NB 14 IDE's LAF combo box 
I also see FlatLAF options and even an additional FlatLAF options tab.
Can anybody please tell me if I do need to manually install some kind of 
FlatLAF JAR with additional calls to UIManager.installLookAndFeel() etc so that 
a NB Platform Application (built by NB14) will start with FlatLAF listed in its 
LAF combo box and ideally have the application start with FlatLAF as default. 
It just seems wrong bc FlatLAF is already in the IDE and has probably been 
optimized for NB too.
Thanks,Mike  

Reply via email to