import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
import java.net.*;
import java.io.File;
import java.awt.image.*;
import javax.imageio.*;
import java.awt.image.BufferedImage;
import java.awt.image.*;
public class TLHMenu extends JFrame implements ActionListener, MouseListener {
private BufferedImage background;
private BufferedImage info;
private BufferedImage neu;
private BufferedImage laden;
private BufferedImage optionen;
private BufferedImage tc;
//...
private JPanel pics;
//...
private JPanel HP;
//...
private JButton saved1;
private JButton saved2;
private JButton saved3;
//...
public static void main(String[] args) throws IOException {
new TLHMenu();
}
TLHMenu() {
//...
makeGui();
try {
background = ImageIO.read(new File("Netz.jpg"));
info = ImageIO.read(new File("Info.gif"));
neu = ImageIO.read(new File("Neu.gif"));
laden = ImageIO.read(new File("Laden.gif"));
optionen = ImageIO.read(new File("Optionen.gif"));
tc = ImageIO.read(new File("TC.gif"));
}
catch(IOException e) {
e.getMessage();
}
setVisible(true);
}
public void paint(Graphics g) {
super.paint(g);
g.drawImage(background, 0, 0, this);
if (einblenden) {
try { Thread.sleep(1000); } catch(InterruptedException e) {}
g.drawImage(neu, 0, 0, this);
try { Thread.sleep(1000); } catch(InterruptedException e) {}
g.drawImage(laden, 0, 60, this);
try { Thread.sleep(1000); } catch(InterruptedException e) {}
g.drawImage(optionen, 0, 120, this);
try { Thread.sleep(1000); } catch(InterruptedException e) {}
g.drawImage(info, 0, 190, this);
try { Thread.sleep(2000); } catch(InterruptedException e) {}
einblenden=false;
}
g.drawImage(neu, 0, 0, this);
g.drawImage(laden, 0, 60, this);
g.drawImage(optionen, 0, 120, this);
g.drawImage(info, 0, 190, this);
g.drawImage(tc, 95, 30, this);
}
public void makeGui() {
//...
HP = new JPanel();
HP.setLayout(null);
//...
saved1 = new JButton("Speicherplatz 1");
saved1.setBounds(173,80,250,19); //476, 20
saved1.addActionListener(this);
saved1.setBackground(Color.GRAY);
//saved1.setEnabled(false);
HP.add(saved1);
saved2 = new JButton("Speicherplatz 2");
saved2.setBounds(173,120,250,19); //476, 20
saved2.addActionListener(this);
saved2.setBackground(Color.GRAY);
//saved2.setEnabled(false);
HP.add(saved2);
saved3 = new JButton("Speicherplatz 3");
saved3.setBounds(173,160,250,19); //476, 20
saved3.addActionListener(this);
saved3.setBackground(Color.lightGray);
saved3.setForeground(Color.GRAY);
//saved3.setEnabled(false);
HP.add(saved3);
add(HP);
//...
public void actionPerformed(ActionEvent event) {
//...
}
public void mouseReleased(MouseEvent ev) { }
public void mousePressed(MouseEvent ev) { }
public void mouseClicked(MouseEvent ev) { }
public void mouseEntered(MouseEvent ev) {
//...
}
public void mouseExited(MouseEvent ev) {
//...
}
//...
}