Menu

How to make Joxy LAF work in Netbeans under Kubuntu 12.04 LTS

2012-06-05
2012-06-13
  • Open Source Junky

    Hi

    First of all, thank you for making Joxy! from the screenies it looks very promising, I can't wait to try it out.

    I'm not sure I'm installing Joxy correctly for being used with Netbeans 7.2 (beta) under Kubuntu 12.04 LTS.

    Here is what I have tried:

    1) I have downloaded the jar file and put it in my home directory.

    2) I have edited netbeans.conf, adding the classpath and laf options like this:

    netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dnetbeans.logger.console=true -J-ea -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.zip.disableMemoryMapping=true --cp:a /my/path/to/joxy-0.0.3.jar --laf joxy.JoxyLookAndFeel"

    3) when I start Netbeans it looks a little different (the colours) but the rest just looks weird. Well the IDE still looks like Metal, just with different colours.

    What am I doing wrong?

    Thank you for your time.

     

    Last edit: Open Source Junky 2012-06-05
  • Thom Castermans

    Thom Castermans - 2012-06-06

    Hi,

    First of all, thank you for trying out Joxy!

    This morning, I have been talking about the issue with Willem. Actually, he runs Kubuntu 12.04 himself and has Netbeans running, so he could test it. Only problem is that he has a version of Netbeans that is a little bit older (I think he has 7.1, but I'm not sure at the moment), which looks pretty different from the (beta) 7.2 version.

    So, I have installed Netbeans from the site (I'm running Debian by the way) this morning and started it with the --laf option. This indeed doesn't look very good, we are aware of that. I have attached a screenshot of Netbeans on my system with Joxy. Note that the menuitem under the mouse looks very ugly, because Joxy currently does not support menuitems with a radiobutton or checkbox. However, the rest definitely is styled. The problem in Netbeans is that they created a lot of custom components (even the toolbar is custom) which Joxy does not style. I suppose we could extend the Netbeans components, but this has no priority at the moment as you may understand.

    If Netbeans looks very different from my screenshot at your system, can you please provide us with a screenshot?

    Lastly I would like to remark that Joxy is a work in progress - some things just aren't styled yet. You can check out the wiki page about the progress of components to see which components are styled and which ones are not.

    Thom

     
  • Open Source Junky

    Ahhhh, ok. It's a pity that Netbeans is using so many custom components, but according to your screenshot there is definately some Joxy styling being applied! I can't say the same, I have also tried now using Netbeans 7.1.2 and I get the same result as with Netbeans 7.2, but I still only get some of the colouring being applied (please refer to my attached screenshot).

    I only placed the joxy jar in my java /ext directory as per your instructions on this site and then added --laf to netbeans:

    --laf joxy.JoxyLookAndFeel
    

    Maybe I should try to load it in a different way?

    As far as Joxy's partial support goes, it does not matter since it's such a big step already in the right direction to get an Oxygen-like LAF for Java apps for KDE. Please keep up the good work :D

    Edit: Damn, Metal is really ugly, I just realised that once again, and had to say it!

     

    Last edit: Open Source Junky 2012-06-06
    • Willem3141

      Willem3141 - 2012-06-06

      Indeed, your screenshot doesn't look like Joxy is doing something...

      Could you take a look in your Netbeans log file? For me, it is located in /home/username/.netbeans/7.1.1/var/log/messages.log. Now in this log file I have "joxy" mentioned many times.

      For example the JAR file joxy-0.0.3.jar is mentioned in the "Application Classpath" in the beginning, Furthermore there are many lines starting with [D] joxy.utils.Utils.getKDEDefaultConfigValue() (that is normal Joxy output). This way we know whether Netbeans at least try to start Joxy.

      Do you have only Java 7, or also Java 6 installed? I remember having problems with that myself, because I copied Joxy to the wrong JRE.

      One last thought; could you start Netbeans with the

      -Dswing.defaultlaf=joxy.JoxyLookAndFeel

      and

      -Dswing.systemlaf=joxy.JoxyLookAndFeel

      options, to try whether Netbeans wants to obey that?

       
  • Open Source Junky

    Hi Willem

    Thank you for your response. I have tried a variety of things by now but still no luck...

    I only have Java 6 installed, and I have joxy-0.0.3.jar installed in path

    /usr/lib/jvm/java-6-openjdk-i386/jre/lib/ext/joxy-0.0.3.jar
    

    Looking at the netbeans logfile, I see the jar being metioned under the section:

    Boot & Ext. Classpath
    

    But in the netbeans logfile I also see:

    Could not install look and feel [Joxy Look and Feel (version current) - joxy.JoxyLookAndFeel]
    [D] joxy.utils.Utils.getKDEDefaultConfigValue(): No value found for key "[Colors:Button]BackgroundNormal", set to default: "223,220,217".
    [D] joxy.utils.Utils.getKDEDefaultConfigValue(): No value found for key "[Colors:Button]DecorationFocus", set to default: "58,167,221".
    [D] joxy.utils.Utils.getKDEDefaultConfigValue(): No value found for key "[Colors:Button]ForegroundNormal", set to default: "34,31,30".
    [W] joxy.utils.Utils.getKDEDefaultConfigValue(): No value found for key "[Colors:Button]ForegroundInactive", but there is no default value.
    

    If I try to start netbeans 7.2 beta with this option, it does not start at all:

    -Dswing.defaultlaf=joxy.JoxyLookAndFeel
    
    1. Maybe I should try installing Java7?
    2. What do you recommend for a Java noob like me?
    3. Can I run some command that gives output about the path in which joxy should be installed?
     

    Last edit: Open Source Junky 2012-06-11
  • Willem3141

    Willem3141 - 2012-06-11

    Netbeans definitely finds the JAR file, because it can read the look-and-feel name ("Joxy Look and Feel (version current)"); that name is inside the JAR. Furthermore Joxy gives the usual debug output, so at least we are sure Joxy has been installed correctly. Joxy should work on Java 6 as well as Java 7; in fact, I am using Java 6 for some other programs and that just works.

    So we have to look for the cause of the problem elsewhere. I have had a look in the Netbeans source code, and they seem to print the error "Could not install look and feel" if there is "some" exception during the look-and-feel loading. Unfortunately they don't print the exception, so we cannot immediately see where the problem happens. I however think this is a bug in the Joxy initialization.

    You say that

    If I try to start netbeans 7.2 beta with this option, it does not start at all:
    -Dswing.defaultlaf=joxy.JoxyLookAndFeel

    Could you do that again, and then look in the log file? Perhaps Netbeans then does print the exception that causes the problem. (You can post the log file here if you are not sure whether something like that happens.)

    In the case that doesn't reveal the problem, I have added some debugging statements in the code of the Git version that fetches the KDE configuration -- I suspect the bug may be there. To make it easier I have compiled the current Git version and put it in the Downloads section under the Debug versions section (joxy.jar). You can just use this version instead of joxy-0.0.3.jar -- it should be stable enough.

    The following eight lines should appear in the log file if you use the Git version:


    [I] joxy.utils.Utils.getKDEColorMap(): Entering getKDEColorMap()
    [I] joxy.utils.Utils.getKDEColorMap(): Exiting getKDEColorMap()
    [I] joxy.utils.Utils.getKDEColorMap(): Entering getKDEColorMap()
    [I] joxy.utils.Utils.getKDEColorMap(): Exiting getKDEColorMap()
    [I] joxy.utils.Utils.getKDEPropertiesMap(): Entering getKDEPropertiesMap()
    [I] joxy.utils.Utils.getKDEPropertiesMap(): Exiting getKDEPropertiesMap()
    [I] joxy.utils.Utils.getKDEIconsMap(): Entering getKDEIconsMap()
    [I] joxy.utils.Utils.getKDEIconsMap(): Exiting getKDEIconsMap()

    Could you please check that these lines are indeed there? If there are lines missing, it may be a clue of what causes the problem.

    Furthermore Thom has fixed missing defaults, so you should not get any output like the following anymore:


    [W] joxy.utils.Utils.getKDEDefaultConfigValue(): No value found for key "[Colors:Button]ForegroundInactive", but there is no default value.

    Possibly, that could also completely solve the issue.

    Thank you for your help!

     

    Last edit: Willem3141 2012-06-11
  • Open Source Junky

    Hi Again

    Ok I tried using the debug (Git) version...

    I get the exact same result, though.

    When starting Netbeans 7.2beta with the following option, it fails to start up:

    -Dswing.defaultlaf=joxy.JoxyLookAndFeel
    

    But when starting Netbeans 7.2beta with the following option, it starts up with only KDE-ish colours as per my original screenshot:

    --laf joxy.JoxyLookAndFeel
    

    The logfile looks a bit different, though:

    [I] joxy.utils.Utils.getKDEColorMap(): Entering getKDEColorMap()
    [W] joxy.utils.Utils.getKDEDefaultConfigValue(): No value found for key "[Colors:Button]ForegroundInactive", but there is no default value.
    Could not install look and feel [Joxy Look and Feel (version current) - joxy.JoxyLookAndFeel]
    

    Thanks for your time!

     

    Last edit: Open Source Junky 2012-06-12
  • Willem3141

    Willem3141 - 2012-06-12

    The second line in the logfile indicates that Joxy couldn't find in your KDE configuration the [Colors:Button]ForegroundInactive setting (that is nothing to be worried about; KDE seems not to save a setting if it has not been changed from the default). I now added a default value for this key, so that line should go away. That's at least one Joxy bug fixed!

    However I tested manually removing this setting from my KDE configuration, and Joxy doesn't crash because of it -- only it painted the button text with the wrong color. So I think this will not solve the issue unfortunately. However you can try: I will put a new joxy.jar in the Downloads.

    If it still doesn't work, did you ever run an application with Joxy successfully? If not, you can easily try the test GUI we created ourselves. It is contained within the Joxy JAR file, so it is easy to launch by going to the folder the JAR is in and executing

    java TestGUI -jar joxy.jar
    

    We created the test GUI in such a way that it prints all the errors it finds. So if this gives exceptions, could you please post them here for us to look at?

    I am going to test the configuration-reading code of Joxy more here, by looking how Joxy behaves if it cannot find any KDE configuration at all. Perhaps that will give pointers to where the problem is.

     
    • Willem3141

      Willem3141 - 2012-06-12

      Sorry, small mistake, the command should be:

      java -cp joxy.jar TestGUI
      
       
  • Open Source Junky

    Hi Willem

    I tried executing the Test GUI but it failed with the following output:

    java -cp joxy.jar TestGUI
    
    [I] joxy.utils.Utils.getKDEColorMap(): Entering getKDEColorMap()
    [W] joxy.utils.Utils.getKDEDefaultConfigValue(): No value found for key "[Colors:Button]ForegroundInactive", but there is no default value.
    java.lang.NullPointerException
            at joxy.utils.Utils.stringToColorUI(Utils.java:465)
            at joxy.utils.Utils.getKDEColorMap(Utils.java:141)
            at joxy.JoxyLookAndFeel.initSystemColorDefaults(JoxyLookAndFeel.java:161)
            at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:146)
            at joxy.JoxyLookAndFeel.getDefaults(JoxyLookAndFeel.java:73)
            at javax.swing.UIManager.setLookAndFeel(UIManager.java:530)
            at javax.swing.UIManager.setLookAndFeel(UIManager.java:574)
            at TestGUI$1.run(TestGUI.java:25)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:226)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:647)
            at java.awt.EventQueue.access$000(EventQueue.java:96)
            at java.awt.EventQueue$1.run(EventQueue.java:608)
            at java.awt.EventQueue$1.run(EventQueue.java:606)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:617)                                                                                                                  
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)                                                                                       
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)                                                                                          
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)                                                                                       
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)                                                                                                   
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
            at javax.swing.MultiUIDefaults.getUIError(MultiUIDefaults.java:133)
            at javax.swing.UIDefaults.getUI(UIDefaults.java:759)
            at javax.swing.UIManager.getUI(UIManager.java:1000)
            at javax.swing.JPanel.updateUI(JPanel.java:126)
            at javax.swing.JPanel.<init>(JPanel.java:86)
            at javax.swing.JPanel.<init>(JPanel.java:109)
            at javax.swing.JPanel.<init>(JPanel.java:117)
            at javax.swing.JRootPane.createGlassPane(JRootPane.java:545)
            at javax.swing.JRootPane.<init>(JRootPane.java:365)
            at javax.swing.JFrame.createRootPane(JFrame.java:271)
            at javax.swing.JFrame.frameInit(JFrame.java:252)
            at javax.swing.JFrame.<init>(JFrame.java:219)
            at TestGUI.showSomeGUI(TestGUI.java:38)
            at TestGUI$1.run(TestGUI.java:32)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:226)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:647)
            at java.awt.EventQueue.access$000(EventQueue.java:96)
            at java.awt.EventQueue$1.run(EventQueue.java:608)
            at java.awt.EventQueue$1.run(EventQueue.java:606)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:617)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
    
     

    Last edit: Open Source Junky 2012-06-12
    • Thom Castermans

      Thom Castermans - 2012-06-13

      Hi Open Source Junky,

      This was indeed a bug in Joxy. Thanks to your help - thanks a lot for testing! - Willem and I have just added defaults (really, all defaults this time) and updated the code so that this NullPointerException will not occur. Actually, it would have occurred in some other places as well, which we also fixed.

      The debug version is now updated, you should have Joxy on the TestGUI and Netbeans when using that one. Of course, this fix will also be included in Joxy 0.0.4, that we will release in a couple of weeks probably.

       

      Last edit: Thom Castermans 2012-06-13
  • Open Source Junky

    Yay! Success it's working now thank you :D

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.