What is all that code for?
Reread my suggestion in post#29. There are two classes: JFrame with a main() method and JPanel with a paintComponent() method. No more.
Type: Posts; User: Norm
What is all that code for?
Reread my suggestion in post#29. There are two classes: JFrame with a main() method and JPanel with a paintComponent() method. No more.
Create a special test program to work out the logic. Create a class that extends JPanel, override its paintComponent() method and add an instance of it to a JFrame so you can see the results.
In...
What is the question?
That is what will happen when you draw multiple Strings at the same location.
Change the values of x and/or y so each String is drawn at its own location.
Please post the full text of the error messages.
When using the methods of the Graphics, you are responsible for positioning where everything goes that is "printed" using a draw method. The...
Can you explain and ask a specific programming question?
You need to set the x and y values for each line you draw with drawString().
For testing you could override the paintComponent in a JPanel and do the drawing there.
From db on another forum:...
Can you state what the problem is?
What is the problem that you are trying to solve? I thought it was using the drawString() method to draw a multi-line String. The rest of the code is in the way for testing that problem. In fact...
I'd rather not do all that.
Can you hardcode a string and use that vs all the other stuff.
Can you make a program that only needs to be compiled and executed to show the problem. The code you posted looks like it wants to read some file. Remove any need for anything besides the code to...
Please explain what you are seeing.
Can you post a small, simple program that compiles, executes and shows what you are talking about?
What happens when you compile and execute the code? Does it do what you want?