I want to create an applet, Please Help...
HI all,
I want to create an applet which should be able to display text and images...
To display text in an applet I am using ...
import java.awt.*;
import java.applet.*;
publicclass SimpleAppletextends Applet
{
publicvoid paint(Graphics g)
{
g.drawString("A Simple Applet", 20, 20);
}
}
Now If I want to create few operators in a different class, and i want to use it from the SimpleApplet class what should be doing.
HI all,
I am creating an Gui: The code is here:
import javax.swing.*;
import java.awt.*;
public class Tab extends JFrame
{
JPanel p,p1,p2,p3,p4,p5;
Frame f1,f2,f3;
JTabbedPane tpane;
public Tab()
{
p = new JPanel();
p1 = new JPanel();
p2 = new JPanel();
p3 = new JPanel();
p4 = new JPanel();
p5 = new JPanel();
tpane = new JTabbedPane();
p.setLayout(new GridLayout(1,1));
tpane.addTab("File",p1);
tpane.addTab("Edit",p2);
tpane.addTab("Document",p3);
tpane.addTab("View",p4);
tpane.addTab("Help",p5);
p.add(tpane);
getContentPane().add(p);
setVisible(true);
}
public static void main(String[] args)
{
// TODO Auto-generated method stub
Tab t = new Tab();
}
}
I want to diaplay some text in the main area left. What should I do.
How to add the Text.