• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet not inialized

 
Nikhilesh Gandhi
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
import java.awt.*;
import javax.swing.*;
import java.applet.*;
/*
<applet code =" Info.Class" width= 300 height=300 >
</applet>
*/
public class Info extends JApplet {

Container contentPane = getContentPane();

JButtonEnter = new JButton("Enter");
JButtonCancel = new JButton("Cancel");
JLabel Luna = new JLabel(" User Name");
JLabel Luco = new JLabel(" User Code");
JLabel Lupd = new JLabel(" User Password");
JLabel Lust = new JLabel(" User Status");

JTextFieldTuna = new JTextField();
JTextFieldTuco = new JTextField();
JTextFieldTupd = new JTextField();
JTextFieldTust = new JTextField();
public void init() {
Insets insets = contentPane.getInsets();
contentPane.setLayout(null);

contentPane.add(Luna);
Luna.setBounds(15 + insets.left, 40 + insets.top, 105, 20);
contentPane.add(Tuna);
Tuna.setBounds(115 + insets.left, 40 + insets.top, 105, 20);
contentPane.add(Luco);
Luco.setBounds(15 + insets.left, 65 + insets.top, 105, 20);
contentPane.add(Tuco);
Tuco.setBounds(115 + insets.left, 65 + insets.top, 105, 20);
contentPane.add(Lupd);
Lupd.setBounds(15 + insets.left, 90 + insets.top, 105, 20);
contentPane.add(Tupd);
Tupd.setBounds(115 + insets.left, 90 + insets.top, 105, 20);
contentPane.add(Lust);
Lust.setBounds(15 + insets.left, 115 + insets.top, 105, 20);
contentPane.add(Tust);
Tust.setBounds(115 + insets.left, 115+ insets.top, 105, 20);
}
}
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What browser and OS are you using? Do you have the Java Plugin installed?

"Applet not initialized" is just a generic error message that just means "there was an error and I couldn't create the applet." To see what caused this, you'll need to pull up the Java Console. The way to pull up the Java Console varies depending on the answers to the questions at the start of my post...
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Applets.
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nikhilesh
I observed that in the applet html you have,
code =" Info.Class"
where the class extension starts in Caps. use Info.class instead and see if it works
Regards
Maulin
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic