Swing textfield

Hi,

I created a simple program in Swing that displays a textfield. In IE, the program displays fine and I can type values into the textfield by first clicking on the textfield. However, in Netscape (both 4.7 and 6.2), the program displays fine but I cannot type anything into the textfield even after clicking on the textfield. In other words, the textfield is never getting the focus. Does anyone know why? I am using the Java plug-in.

Here is the simple code:

import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

public class TextDemo extends JApplet{

public void init() {

JPanel topPanel = new JPanel();

topPanel.setLayout( new FlowLayout());

getContentPane().add(topPanel);

JTextField textField = new JTextField(20);

topPanel.add(textField);

}

}

[854 byte] By [time83a] at [2007-9-27 5:08:03]
# 1
Hi time83,Just a guess, but did you try setting the visibility and enabling topPanel?topPanel.setVisible(true);topPanel.setEnabled(true);Other than that, I'd think it was the plugin.Regards,Nick G.
gianakas13a at 2007-7-8 1:23:26 > top of Java-index,Archived Forums,Swing...
# 2
You might also want to try setting the JTextField to be editable:textField.setEditable(true);SN
sniezg01a at 2007-7-8 1:23:26 > top of Java-index,Archived Forums,Swing...
# 3
Hi,I tried both of your methods but the same thing happens. It can't be the plug-in because I upgraded to the latest version when the problem first appeared. It did not help.
time83a at 2007-7-8 1:23:26 > top of Java-index,Archived Forums,Swing...
# 4
Has anyone experienced this problem before?
time83a at 2007-7-8 1:23:26 > top of Java-index,Archived Forums,Swing...
# 5
I tried out your code and it works fine.I used netscape 6.2.1There's no problem with it.cheers.
sanjeevdga at 2007-7-8 1:23:26 > top of Java-index,Archived Forums,Swing...
# 6
Thank you sanjeevdg for trying out my code. Are you running Windows98?
time83a at 2007-7-8 1:23:26 > top of Java-index,Archived Forums,Swing...
# 7
Yes. Are you still having problems ?
sanjeevdga at 2007-7-8 1:23:26 > top of Java-index,Archived Forums,Swing...
# 8
I uninstalled the plug-in on my system and downloaded and installed the current version. The problem is not showing up anymore. Looks like this fixed the problem. Thanks to all who helped.
time83a at 2007-7-8 1:23:26 > top of Java-index,Archived Forums,Swing...