473,396 Members | 1,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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!
May 17 '06 #1
1 2069
Nevermind, I solved it.
May 18 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Laura | last post by:
Hello, Newbie question: Does anyone know how to dynamically set the screen width in an applet? I have an applet that creates a horizontal bar menu on a webpage, and I would like the width to be...
1
by: Put 030516 in email subj to get thru | last post by:
I've always been bothered about having to statically declare the size of a Java applet window (container?) in the calling HTML. I've always wanted the moral equivalent of width=50% statement (of...
4
by: Warrick Wilson | last post by:
I've got a web page that uses frames. One of the frames loads an HTML page that redirects to a 3rd HTML page. This third page loads a Java applet - ProScroll.class - that runs a "news ticker"...
2
by: Put 030516 in email subj to get thru | last post by:
I've always been bothered about having to statically declare the size of a Java applet window (container?) in the calling HTML. I've always wanted the moral equivalent of width=50% statement (of...
6
by: haran22 | last post by:
verify and tell me what runtime error in this pgm import java.awt.*; import java.applet.*; import java.awt.event.*; import java.sql.*; public class screen extends Applet implements...
1
by: dishal | last post by:
Can anyone help me please? How do I convert these codes to launch from a JFrame instead of a Java Applet? A simple program where the user can sketch curves and shapes in a variety of...
2
by: Prasad | last post by:
This was our earlier design <Product Inventory Info> <Company> <Make>Computer General</Make> <Model>Wizbang 1900</Model> It was later found that <Product Inventory Infohad spaces in...
14
jhardman
by: jhardman | last post by:
I am having a hard time opening a text file from an applet. I remembered after an attempt or two that there were obvious security issues here, so I switched the code to pull a text file off the...
1
by: kummu4help | last post by:
hi, i want to draw rectangle based on mousedrag event. if user dragging the mouse, then the rectangle on the applet should increase or decrease basing on current mouse coordinates. i have the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.