Java Slideshow in BlueJ...Help!
Hi,
I am completely new to Java and signed up for the forums because I am in serious need of assistance please...
I am trying to create an image slideshow in BlueJ...here is my code so far,
Code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
/**
* Write a description of class SlideShow here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class SlideShow implements ActionListener
{
private JFrame frame;
private JLabel pictureLabel;
private JTextField field;
private JButton clickButton;
private static final String PATH = "Pictures";
/**
* Constructor for objects of class SlideShow
*/
public SlideShow()
{
makeFrame();
}
/**
* An example of a method - replace this comment with your own
*
* @param y a sample parameter for a method
* @return the sum of x and y
*/
private void makeFrame()
{
frame = new JFrame ("Slide Show");
JMenuBar menubar = new JMenuBar();
frame.setJMenuBar(menubar);
JMenu fileMenu = new JMenu ("Select Picture");
menubar.add(fileMenu);
JMenuItem thisItem = new JMenuItem("Pic01.jpg");
thisItem.addActionListener(this);
fileMenu.add(thisItem);
JMenuItem thatItem = new JMenuItem("Pic02.jpg");
thatItem.addActionListener(this);
fileMenu.add(thatItem);
JMenuItem otherItem = new JMenuItem("Pic03.jpg");
otherItem.addActionListener(this);
fileMenu.add(otherItem);
Container contentPane = frame.getContentPane();
JLabel label = new JLabel("The World Cup's Greatest Players");
pictureLabel = new JLabel();
pictureLabel.setIcon(new ImageIcon(PATH + "Pic01.jpg"));
clickButton = new JButton ("Change Picture");
clickButton.addActionListener(this);
frame.pack();
frame.setVisible(true);
}
}
I realise for the slideshow to work properly I need to add a timer, timercount and I am also going to create if possible a second class called main whereby the file can be opened using dos. I am completely stuck on where to go next, could somebody point me in the right direction?
Thanks.