Programa Genera Aleatorios
* @(#)Text1.java
*
*
* @author
* JEAB
*
*
*
* @version 1.00 2011/9/3
*/
import java.awt.*;
import javax.swing.*;
import java.awt.event.ActionEvent;
importjava.awt.event.ActionListener;
import java.util.ArrayList;
import java.text.DecimalFormat;
public class Aleatorios extends JFrame implements ActionListener{
private JFrame FRMPRINCIPAL = newJFrame("NUMEROS ALEATORIOS");
private JTextArea JTFNUMEROS = new JTextArea(6,80);
private ImageIcon IILOGO = new ImageIcon("");
private JLabel JLBLOGO = new JLabel(IILOGO);
privateString CANTIDADNUMEROS;
private String DECIMALES;
private int NUMERO;
private int CONTADOR = 0;
private int LIMITENUMEROS = 21;
private int CANTIDADDECIMALES;
privateint LIMITEDECIMALES = 5;
private ArrayList LISTANUMEROS = new ArrayList();
DecimalFormat NFORMAT = new DecimalFormat();
private JButton JBLIMPIAR = new JButton("Limpiar");private JButton JBGENERANUMEROS = new JButton("Genera");
public Aleatorios() {
JTFNUMEROS.setLineWrap(true);
JTFNUMEROS.setWrapStyleWord(true);
JTFNUMEROS.setBounds(0,0,100,600);JBGENERANUMEROS.setBounds(100,50,200,50);
JBLIMPIAR.setBounds(100,200,200,50);
FRMPRINCIPAL.setSize(310,600);
FRMPRINCIPAL.getContentPane().setLayout(null);FRMPRINCIPAL.add(JTFNUMEROS);
FRMPRINCIPAL.add(JBGENERANUMEROS);
FRMPRINCIPAL.add(JBLIMPIAR);
FRMPRINCIPAL.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);FRMPRINCIPAL.setVisible(true);
JBGENERANUMEROS.addActionListener(this);
JBLIMPIAR.addActionListener(this);
}
public int orquestador(){
CANTIDADNUMEROS =JOptionPane.showInputDialog(null,"Cuantos numeros aleatorios quieres generar?","Ingresa un numero del 1 al 20",JOptionPane.QUESTION_MESSAGE);
if(validaNumero(CANTIDADNUMEROS) == true){
DECIMALES =...
Regístrate para leer el documento completo.