package grafica; import java.awt.*; import java.awt.event.*; import java.applet.*; public class GraficaApplet extends Applet { MiCanvas canvas; boolean isStandalone = false; Panel panel1 = new Panel(); Panel panel2 = new Panel(); Panel panel3 = new Panel(); Panel panel4 = new Panel(); FlowLayout flowLayout1 = new FlowLayout(); FlowLayout flowLayout2 = new FlowLayout(); FlowLayout flowLayout3 = new FlowLayout(); BorderLayout borderLayout1 = new BorderLayout(); BorderLayout borderLayout2 = new BorderLayout(); Label label1 = new Label(); Choice chGases = new Choice(); Label label2 = new Label(); TextField tTemperatura = new TextField(); Button btnGrafica = new Button(); Button btnBorrar = new Button(); //Construct the applet public GraficaApplet() { } //Initialize the applet public void init() { try { jbInit(); } catch (Exception e) { e.printStackTrace(); } } //Component initialization public void jbInit() throws Exception{ int ancho = Integer.parseInt(this.getParameter("WIDTH")); int alto = Integer.parseInt(this.getParameter("HEIGHT")); this.setSize(new Dimension(ancho, alto)); canvas=new MiCanvas(); panel1.setBackground(Color.lightGray); panel4.setBackground(Color.gray); panel1.setLayout(borderLayout1); panel4.setLayout(flowLayout3); panel3.setLayout(flowLayout2); panel2.setLayout(flowLayout1); flowLayout1.setVgap(1); flowLayout2.setVgap(1); flowLayout3.setVgap(1); this.setLayout(borderLayout2); String str[]={"Hidrógeno (H2)", "Oxígeno (O2)", "Nitrógeno (N2)", "Helio (He)", "Neón (Ne)", "Argón (Ar)"}; for(int i=0; i