Search:

Type: Posts; User: Norm

Search: Search took 0.27 seconds.

  1. Replies
    8
    Views
    1,431

    Re: Program won't work on all operation systems

    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?
  2. Replies
    8
    Views
    1,431

    Re: Program won't work on all operation systems

    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...
  3. Replies
    8
    Views
    1,431

    Re: Program won't work on all operation systems

    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.
  4. Replies
    8
    Views
    1,431

    Re: Program won't work on all operation systems

    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()
    ...
Results 1 to 4 of 4