Proyecto visor de imagen aprendiz

Solo disponible en BuenasTareas
  • Páginas : 2 (322 palabras )
  • Descarga(s) : 0
  • Publicado : 19 de abril de 2010
Leer documento completo
Vista previa del texto
import java.io.*;
import java.io.FileInputStream.*;
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
import java.lang.NullPointerException.*;
/*
* To change this template,choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author MIXRAR
*/
public class tarea15042010 {

static tarea15042010 metodico = new tarea15042010();static JFrame frame;
static Container contenedor;
static ImageIcon img;
static String aqui = "./imagenes";
static String al;
static File file = new File(aqui);
staticString[] imagenes = file.list();
static JPanel panel1;
static int archivos, i = 0;
static JButton b1, b2, b3;
static JLabel label1, label2;

/**
* @param args the commandline arguments
*/
public static void main(String[] args) throws FileNotFoundException {
al = "./imagenes/" + imagenes[i];
frame = new JFrame("Tarea 15/04/2010");frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);
frame.setPreferredSize(new Dimension(500, 400));
frame.setVisible(true);
contenedor = new Container();contenedor.setPreferredSize(new Dimension(500, 400));
contenedor.setLayout(new BorderLayout());
archivos = imagenes.length;
label1 = new JLabel();label1.setPreferredSize(new Dimension(200, 200));
panel1 = new JPanel();
img = new ImageIcon(al);
b1 = new JButton("Siguiente");
b1.setVisible(true);
b1.setPreferredSize(newDimension(100, 25));
b1.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent Q) {

metodico.boton1();
}
});b2 = new JButton("Retroceder");
b2.setPreferredSize(new Dimension(100, 25));
b2.setVisible(true);
b2.addActionListener(new ActionListener() {

public void...
tracking img