Arreglos en java... applet

Páginas: 2 (311 palabras) Publicado: 17 de noviembre de 2010
import java.applet.Applet;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.*;

@SuppressWarnings("serial")
publicclass AppletArreglo extends Applet implements ActionListener{

int arreglo1[] = new int [50];
int cantidad = 0;

float arreglo3[] = new float [50];

String arreglo2[] = new String [50];String muestra = "";

JButton BttnAñade = new JButton("Añade");
JButton BttnMuestra = new JButton("Muestra Arreglo");
JButton BttnLimpiaA = new JButton("Limpia Arreglos");
JButtonBttnLimpiaC = new JButton("Limpia Campos");

JLabel LblNumero = new JLabel("Número");
JLabel LblNombre = new JLabel("Nombre");
JLabel LblSaldo = new JLabel("Saldo");

JScrollPane Scroll;JTextArea TxtMuestra = new JTextArea("");

JTextField TxtNumero = new JTextField("");
JTextField TxtNombre = new JTextField("");
JTextField TxtSaldo = new JTextField("");

JPanel Panel1= new JPanel(new GridLayout(3, 2, 5, 5));
JPanel Panel2 = new JPanel(new GridLayout(2, 2, 5, 5));

public AppletArreglo() {

BttnAñade.addActionListener(this);BttnMuestra.addActionListener(this);
BttnLimpiaA.addActionListener(this);
BttnLimpiaC.addActionListener(this);

Scroll = new JScrollPane(TxtMuestra);
Scroll.setAutoscrolls(true);Panel1.add(LblNumero);
Panel1.add(TxtNumero);
Panel1.add(LblNombre);
Panel1.add(TxtNombre);
Panel1.add(LblSaldo);
Panel1.add(TxtSaldo);

Panel2.add(BttnAñade);
Panel2.add(BttnMuestra);Panel2.add(BttnLimpiaA);
Panel2.add(BttnLimpiaC);

this.setLayout(new GridLayout(3, 1, 5, 5));
this.add(Panel1);
this.add(Scroll);
this.add(Panel2);

}

@Override
public voidactionPerformed(ActionEvent e) {

if (e.getSource() == BttnAñade) {

if (cantidad < 50) {

try {

arreglo1[cantidad] = Integer.parseInt(TxtNumero.getText());...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • APPLET DE JAVA
  • Arreglos en java
  • Arreglos En Java
  • Arreglos en java
  • Arreglo java
  • Arreglos Java
  • Arreglos en java
  • reversi java applet

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS