Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

First time using JApplet, applet not initialized?

 
Vaughn Stewart
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Below is the client class for the project I'm doing,
this is the first time we've had to use applets instead of
a JFrame, I have no idea why it won't run, any ideas?

import javax.swing.*;
import java.awt.*;
import javax.swing.JApplet;

public class ConferenceClient extends JApplet
{
private ConferenceGUI gui;
private Container c;
final int WIDTH = 700;
final int HEIGHT = 250;

public void init()
{
gui = new ConferenceGUI();
c = getContentPane();
c.setLayout(new BorderLayout());
c.add(gui,null);
c.setSize(WIDTH,HEIGHT);
}
}
 
Darryl Burke
Bartender
Posts: 5125
11
Java Netbeans IDE Opera
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vaughn Stewart wrote:I have no idea why it won't run, any ideas?

ItDoesntWorkIsUseless. TellTheDetails.

That said, I've never seen a null constraint passed when adding a component to a BorderLayout. Have you read this? Also, don't setSize(...) -- the layout manager takes care of that.

And welcome to the Ranch!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic