-
Blank Applet Screen
Hi, I'm new to these boards. I am currently working on a java applet (stand alone - no html stuff) and I'm having a little problem. When I run the following code, nothing appears on the applet until i resize the frame while it's running (and then it works just fine):
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.font.*;
import java.text.DecimalFormat;
import javax.swing.*;
import java.util.Date;
import static java.awt.BorderLayout.*;
public class WidgetStore extends JApplet implements ActionListener
{
//declare variables and images
ImageIcon introScreen = new ImageIcon("IntroScreen.gif");
JLabel introScreenLabel = new JLabel(introScreen);
//construct components and containers
JButton proceedButton = new JButton("Enter");
Container c = getContentPane();
JPanel topIntroPanel = new JPanel();
JPanel bottomIntroPanel = new JPanel();
public void paint(Graphics g)
{
}
public void init()
{
//set frame properties
setSize(350,325);
//create panels and add or change various components
c.setLayout(new BorderLayout());
topIntroPanel.setLayout(new FlowLayout());
bottomIntroPanel.setLayout(new FlowLayout());
c.add(topIntroPanel, NORTH);
c.add(bottomIntroPanel, CENTER);
topIntroPanel.add(introScreenLabel);
topIntroPanel.setBackground(Color.black);
bottomIntroPanel.add(proceedButton);
bottomIntroPanel.setBackground(Color.black);
}
public void actionPerformed(ActionEvent e)
{
}
}
I don't understand what's causing the applet to not display anything until a resizing of the frame occurs....moving the frame around doesn't do anything either.
All help appreciated! Thanks!
-
Similar Threads
-
By Tataroz T. in forum Java
Replies: 1
Last Post: 10-20-2005, 06:19 AM
-
By jeynergilcaga in forum Java
Replies: 3
Last Post: 08-18-2005, 10:07 PM
-
Replies: 0
Last Post: 03-07-2005, 03:24 PM
-
By Charlie Flynn in forum Java
Replies: 3
Last Post: 08-23-2001, 11:01 AM
-
By Rocco Balsamo in forum Java
Replies: 1
Last Post: 07-27-2000, 12:50 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks