1. When will getGraphics() return a valid graphics instance? stackoverflow.comI'm trying to render a custom Swing component where I've extended the JComponent class. For the purpose of simplifying the component requirements, lets just summarize my component as needing to render a ... |
2. Any alternative to calling getGraphics() which is returning null stackoverflow.comFrequently when I call getGraphics() it returns null, even if I set the xxx.getGraphics(); xxx to be visible (as a Google search shows...) But this doesn't work, and this frustrates me ... |
3. getGraphics() null but paint() still works! coderanch.comHello! I am currently working on an image viewer program and am having a bit of difficulty displaying the Image objects themselves. Basically, I created an ImagePanel class with a paintComponent(Graphics g) method. When I use this, the image does in fact show up in the ImagePanel panel, but I am still getting a null pointer exception and a stack trace. ... |