This site requires JavaScript, please enable it in your browser!
Greenfoot back
Nosson1459
Nosson1459 wrote ...

2017/2/21

UIManager in NetBeans

Nosson1459 Nosson1459

2017/2/21

#
Why doesn't the following work in NetBeans while it works in Greenfoot and in JCreator?
try
{
    // Set System L&F
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} 
catch (UnsupportedLookAndFeelException e)
{
    // handle exception
}
catch (ClassNotFoundException e)
{
    // handle exception
}
catch (InstantiationException e)
{
    // handle exception
}
catch (IllegalAccessException e)
{
    // handle exception
}
In Greenfoot and NetBeans the JComponents looks like the other ones on my computer but in NetBeans they have the Java metal L&F. I usually put the above code in the main method:
public static void main(String[] args)
but it didn't work in NetBeans so I tried putting it in the beginning and the end of the constructor but it still had the Java L&F.
Nosson1459 Nosson1459

2017/3/2

#
No one seems to know the answer to this question.
Nosson1459 Nosson1459

2017/3/3

#
No replies besides for my own.
Nosson1459 Nosson1459

2017/3/14

#
It seems to me that there hasn't been anyone on the Greenfoot site in the past 12 days that has used the line UIManager.setLookAndFeel in NetBeans, to see why it doesn't work in that particular IDE.
Super_Hippo Super_Hippo

2017/3/14

#
Well, I am not using anything else than Greenfoot and that's why I have no idea what you are doing there. Yes, it is frustrating to not get an answer, but getting a not useful one is probably not helping you either =/ Maybe you have to contact the NetBeans support, but I don't know.
Nosson1459 Nosson1459

2017/3/14

#
Super_Hippo wrote...
getting a not useful one is probably not helping you either
I agree. I didn't ask for a not useful answer (I'm NOT saying that that's exactly what you gave me).
Maybe you have to contact the NetBeans support, but I don't know.
Maybe, but I was asking here in case there was something I was doing wrong (the code is in a class which extends World, so it does have a little bit to do with Greenfoot but that method doesn't have anything to do with Greenfoot alone).
You need to login to post a reply.