Java/Swing programming question

Miscellaneous Forums/General Discussion/Java/Swing programming question

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

You may have to make your own paint() method in a thread, and use that one... not the one of the superclass!

something like:-

(If any part is wrong, sorry) :)

import java.awt.*;

public class blah extends javax.swing.JApplet
   implements Runnable {

   Thread runner;
   int pause = 500

 public void init() {
 }

 public void paint(Graphics screen){
   super.paint(screen);
   graphics2d screen2d = (graphics2D) screen;
   other code  
}

 public void start()
  if runner == null {
 runner = new Thread)(this)
 runner.start();

 public void run() {
 Thread thisthread = thread.currentthread();
 while (runner == thisthread) {
  repaint()
  }
  }

 public void stop() {
 if runner != null {
 runner = null
}
}


I think that's roughly how it works when using threads! :/

Dabz