Search:

Type: Posts; User: Norm

Search: Search took 0.09 seconds.

  1. Replies
    15
    Views
    2,110

    Re: Can't simultaneously run two threads??

    You define a component like JPanel and override its paintComponent() method. It will be called when the JPanel's repaint() method is called. There will be a list of the Balls to draw that the...
  2. Replies
    15
    Views
    2,110

    Re: Can't simultaneously run two threads??

    A thread is not a component. You can have many threads used by or using one component. By component I mean a class that extends the Component class, like JPanel or JButton.
  3. Replies
    15
    Views
    2,110

    Re: Can't simultaneously run two threads??

    Change the logic to have a single component with an override to the paintComponent() method that has a list of balls to draw within its area.
  4. Replies
    15
    Views
    2,110

    Re: Can't simultaneously run two threads??

    I have no ideas.
  5. Replies
    15
    Views
    2,110

    Re: Can't simultaneously run two threads??

    Yes that's it. Make these changes to see:


    setSize(FRAME_WIDTH, FRAME_HEIGHT);
    setLayout(new GridLayout(4,1)); //<<<<<<<<<<<<<<<< ADDED

    addBall(10,50);
    ...
  6. Replies
    15
    Views
    2,110

    Re: Can't simultaneously run two threads??

    Sorry, having 5 separate files makes it hard to copy for testing.
    Can you put all the source into a single file to make it easier to copy and paste into my editor for testing?

    I got it.

    I get...
  7. Replies
    15
    Views
    2,110

    Re: Can't simultaneously run two threads??

    Please post the code here on the forum.
  8. Replies
    15
    Views
    2,110

    Re: Can't simultaneously run two threads??

    For testing this kind of problem you need a program that compiles, executes and shows the problem.
    Please make a small program for testing and post it.
Results 1 to 8 of 8