But why wont the textfield show up when I run this?
Instead, when I place mouse over where the text field is , it will
change from pointer to edit pointer as if to say its there but I cant
see it.. the area is entirely white.
The only way it shows up is when I left click on it, then finaly I
can see the textfield outline
And the drawstrings show up right away...
is there a problem with my code or , my OS screwed up?
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class Server extends JApplet implements ActionListener {
JTextField hostIp;
public void init() {
Container cPane = getContentPane();
cPane.setLayout(new FlowLayout());
hostIp = new JTextField("0.0.0.0",15);
hostIp.setActionCommand("hostIp");
hostIp.addActionListener(this);
cPane.add(hostIp);
}
public void actionPerformed(ActionEvent e) {
}
public void paint(Graphics g) {
g.drawString("Welcome to Java!!", 50, 60 );
g.drawString("WTF , why isnt my text field visible!!!fark!!", 50, 0 );
}
}