I'm trying to get look and feel to work with no success. I'm creating a Frame and painting an Applet inside it. No exceptions are thrown when I execute the program.
AppScreen < Applet:
public class AppScreen extends Applet implements Runnable {
protected AppFrame frame;
protected Graphics appGraphics;
public void createFrame(int width, int height) throws Exception {
UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceRavenGraphiteGlassLookAndFeel");
frame = new AppFrame(this, width, height);
appGraphics = getAppComponent().getGraphics();
startThread(this, 1);
}
public void startThread(Runnable runnable, int i) {
final Thread thread = new Thread(runnable);
thread.start();
thread.setPriority(i);
}
public Component getAppComponent() {
if (frame != null)
return frame;
else
return this;
}
}
AppFrame < Frame:
public final class AppFrame extends Frame {
private final AppScreen screen;
public AppFrame(AppScreen screen, int width, int height) {
this.screen = screen;
setBounds(500, 500, width, height);
setResizable(false);
setVisible(true);
toFront();
}
@Override
public final void update(Graphics g) {
screen.update(g);
}
@Override
public final void paint(Graphics g) {
screen.paint(g);
}
}
For instance, I call createFrame(width, height) method.