I am working with some code that writes animated output to the desktop using AWT and Swing features. It draws using 2D graphics and renders text in fonts. This code can use the Java Media Framework to save the animationto movie files. I would like to port this code to a pure server-side environment, for working with a Web UI.
Tag: awt
Java – FontMetrics without Graphics
How to get FontMetrics without use Graphics ? I want to get FontMetrics in constructor, now I do this way: Answer Hmm… It is quite logical that you need graphics to get FontMetrics. Font height, width etc. can differ on various displays. If you have some Component, you can use it for getting FontMetrics:
Why does my icon handling code throw a NullPointerException?
I have added an image for my button,but when I run that frame this exception will be thrown .why?please help me. line 138: line91: I use this poor checking (Peter Lang recommended)which is:System.out.println(getClass().getResource(“/Images/yahoo_1.gif”)); and it returns null,why? please help me. Answer This means, that getClass().getResource(“/Images/yahoo_1.gif”) returns null. JavaDoc states that this happens if the resource could not be found or