File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes First time using JApplet, applet not initialized? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Applets
Reply Bookmark "First time using JApplet, applet not initialized?" Watch "First time using JApplet, applet not initialized?" New topic
Author

First time using JApplet, applet not initialized?

Vaughn Stewart
Greenhorn

Joined: Feb 03, 2012
Posts: 1

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

Joined: May 03, 2008
Posts: 3216

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!


luck, db
There are no new questions, but there may be new answers.
 
 
subject: First time using JApplet, applet not initialized?
 
Threads others viewed
Not to show the ellipse?
Virtual Graphing Calculator
First time with applets
Not able to change Background color of a component
Not drawing the Button?
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture