Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applets and swing UI

 
S. Lohi
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello.

I have a little problem with my java applet. I originally programmed it to be used stand-alone on one's computer, but I'd like to have it on my website as well.

The applet uses swing and JFrame to open a window. When I enter the page where the applet should be loaded, it loads it with no errors, but no window is displayed. Here's the start-code for the applet:

---

import java.applet.Applet;
import javax.swing.*;

public class ClientInit extends Applet {

public void start() {

launchApp();

}

public Thread launchApp() {
Thread launch = new Thread() {
public void run() {
ClientMain.launchInterface();
}
};
launch.run();
return null;
}

}

---

ClientMain.launcInterface is where the code for launching the window is.

This program works when the start-method is replaced with a main-method.

I have tried changing the start-method to init but with no results. I have tried it inside a thread (like here) and with no thread, no effect. I know something about java programming but nothing about applets, so any kind of help is appriciated.

- Sampsa Lohi
[ September 18, 2004: Message edited by: S. Lohi ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic