aspose file tools
The moose likes Applets and the fly likes applets Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Applets
Reply Bookmark "applets" Watch "applets" New topic
Author

applets

josephine chen
Ranch Hand

Joined: Oct 29, 2002
Posts: 216

<pre>
import java.awt.*;
import java.awt.event.*;
class TextBox extends Frame implements KeyListener{
TextField t1;
void createtext(){
System.out.println("create text");
t1 = new TextField();
add(t1);
setLayout(new FlowLayout());
setVisible(true);
setSize(200,400);
t1.addKeyListener(this);
}
public void keyPressed(KeyEvent e){
if (e.getKeyCode() == 10){
System.out.println("fdaSD");
}
}
public void keyReleased(KeyEvent e){ }
public void keyTyped(KeyEvent e){ }


}
class box extends java.applet.Applet{
public void init(){
System.out.println("hai");
TextBox t = new TextBox();
t.createtext();
System.out.println("helloi");

}
}

</pre>
I am getting message saying applet started but my textbox doresnot appear why???
alberto sierra
Greenhorn

Joined: Mar 21, 2000
Posts: 4
Try using the pack() and show() methods in a constructor for your frame or t.pack() and t.show() after new TextBox().
josephine chen
Ranch Hand

Joined: Oct 29, 2002
Posts: 216
I am getting the applet but the problem is i am not able to close it.
What should I do to close it?
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: applets
 
Similar Threads
Can one applet load another?
Applet -Applet communication prb
Trapping keys in java applet
Problem with KeyEvent and VK_TAB
TextField(Urgent)