eu preciso escrever isso em um applet:
[img]http://img199.imageshack.us/img199/6730/semttulofu.jpg[/img]
import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import javax.swing.JApplet;
import javax.swing.JLabel;
/**
*
* @author Ton
*/
public class NewJApplet2 extends JApplet {
private JLabel lblPts1;
private JLabel lblArestas;
private JLabel lblDois1;
private JLabel lblMais1;
private JLabel lblPts2;
private JLabel lblInternos;
private JLabel lblIgual1;
private JLabel lblArestas2;
private JLabel lblDois2;
private JLabel lblMais2;
private JLabel lblInternos2;
private JLabel lblIgual2;
private JLabel lblArea;
@Override
public void init() {
lblPts1 = new JLabel("Pontos nas");
lblArestas = new JLabel("Arestas");
lblDois1 = new JLabel("2");
lblMais1 = new JLabel("+");
lblPts2 = new JLabel("Pontos no");
lblInternos = new JLabel("Interior");
lblIgual1 = new JLabel("=");
lblArestas2 = new JLabel("50");
lblDois2 = new JLabel("2");
lblMais2 = new JLabel("+");
lblInternos2 = new JLabel("100");
lblIgual2 = new JLabel("=");
lblArea = new JLabel("125");
Container c=getContentPane();
GridBagConstraints cons = new GridBagConstraints();
GridBagLayout layout = new GridBagLayout();
c.setLayout(layout);
cons.fill = GridBagConstraints.BOTH;
cons.gridx = 0;
cons.gridy = 0;
c.add(lblPts1, cons);
cons.gridx = 0;
cons.gridy = 1;
c.add(lblArestas, cons);
cons.gridx = 0;
cons.gridy = 2;
c.add(lblDois1, cons);
cons.gridx = 1;
cons.gridy = 0;
cons.gridheight = 3;
c.add(lblMais1, cons);
cons.gridx = 2;
cons.gridy = 0;
cons.gridheight = 1;
c.add(lblPts2, cons);
cons.gridx = 2;
cons.gridy = 1;
c.add(lblInternos, cons);
cons.gridx = 3;
cons.gridy = 0;
cons.gridheight = 3;
c.add(lblIgual1, cons);
cons.gridx = 4;
cons.gridy = 1;
cons.gridheight = 1;
c.add(lblArestas2, cons);
cons.gridx = 4;
cons.gridy = 2;
c.add(lblDois2, cons);
cons.gridx = 5;
cons.gridy = 0;
cons.gridheight = 3;
c.add(lblMais2, cons);
cons.gridx = 6;
cons.gridy = 0;
c.add(lblInternos2, cons);
cons.gridx = 7;
cons.gridy = 0;
c.add(lblIgual2, cons);
cons.gridx = 8;
cons.gridy = 0;
c.add(lblArea, cons);
}
}
existe alguma forma melhor pra escrever em um applet? >.<"