I know what's throwing it. It is trying to draw an image that initially won't be defined till I hit a button.
I was asking how to fix the repaint() call.
setFile() should instantiate it. ...
Type: Posts; User: javapenguin
I know what's throwing it. It is trying to draw an image that initially won't be defined till I hit a button.
I was asking how to fix the repaint() call.
setFile() should instantiate it. ...
Got some things to work, but the image still isn't being drawn when I call getImage().
Also, how do I deal with the Null Pointer Exception?
import java.awt.event.*;
import java.awt.*;...
But how do people have different methods to draw something?
Also, paint seems to be being called repeatedly.
Also, another funny thing, I don't quite get how an abstract method from Graphics...
It looks like the one you posted when you first started, yes.
How do I fix that?
In addition to that, apparently I don't know how to use getGraphics().
I tried it in another test program...
Why does my token for this page keep expiring?
Anyway, I got this when I enlarged it:
If you mean that I don't have any title for the JFrame or anything in the JPanel object that is attached to the tab, you are correct.
Though why it won't add an image though it should to the...
There should be more. Not sure what you mean by "only title bar".
Here is what I have now:
import java.awt.event.*;
import java.awt.*;
import java.util.*;
import java.io.*;
import...
The first example at the very beginning was a simpler example.
The one I'm talking about now is far more complex.
Sorry for the confusion.
I was able to solve the original problem, I...
I tried painting a component and it won't paint.
I think I'm having trouble understanding how to use paint and stuff.
I have a better code but now everything compiles without exceptions but...
Ok, I altered it to avoid that unknown class altogether.
But now it got rid of Null Pointer message but still my image must be being drawn in invisible ink.
How do I make it show up?
...
I had thought so, but it appears that the println statement is throwing the error.
To make this more bizzare, I recopied the code into the class's paint method and called it and instead of making...
I believe that the variable willthiswork is null.
I tried printing it and it threw a Null Pointer Exception so that proves it.
The question is....why is it null?
I instantiated it.
To stop making a very long post, I'm going to another post.
I've just noticed something else. It says that I have to turn off double buffering to use DebugGraphics.
I'm not even quite sure...
Add image to jar file.
I'm not sure what Kevin meant by BufferedImage and dirty windows.
I am trying something, to see if my plan would work to use a DebugGraphics object to be used to call a...
Painting as in Microsoft Paint is what I'm referring to.
However, it probably wouldn't hurt to call paintComponent() all the same.
However, Graphics still is abstract. I did think of passing...
Ok, I changed it to Component and it neither hurt it nor really made it show up.
Hmmmmm...by any chance is that problem with the JScrollPane a problem with my layout?
The thought just occurred...
I figured out a way to get it to work by using Box Layout. Though I didn't try it with the test program, but another, bigger one.
However, I have two new problems, one of them is probably...
For some reason the JTabbedPane isn't showing up. I tried changing its orientation to bottom and then left to see if that would fix it but it didn't.
It was just a simple program to see if all...