That is something that a good design would isolate to one variable vs having hard coded magic numbers hidden in the code.
Is that what the 30 that I see here and there is used for?
Type: Posts; User: Norm
That is something that a good design would isolate to one variable vs having hard coded magic numbers hidden in the code.
Is that what the 30 that I see here and there is used for?
I only have XP so you'll have to wait for someone with another OS.
I don't know how putting the paint method in a JPanel would cause you problems.
What do the problems look like? What works...
The changes were to put the paint method in a JPanel class. That's all I did.
Replace the definition of p,
insert the class MyJPanel ... {
and the ending }
and change paint to paintComponent.
Some suggested code changes to make the drawing a bit smoother:
MyJPanel p = new MyJPanel(); // Use your own class
...
class MyJPanel extends JPanel { // Add this line before paint()
...