HI, ich bin ein Anfänger und habe diese Frage
Code:
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.*;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.*;
class VideoRecorder extends JFrame implements ActionListener {
JButton play = new JButton("Play");
JButton stop = new JButton("Stop");
JButton quit = new JButton("Quit");
quit.addActionListener(this);
JButton minimize = new JButton("Minimize");
minimize.addActionListener(this);
JButton maximize = new JButton(Maximize);
maximize.addActionListener(this);
public OselPlayer() {
super("Osel Media Player");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
FlowLayout lm = new FlowLayout(FlowLayout.LEFT);
JPanel pre = new JPanel();
setLayout(lm);
pre.add(play);
pre.add(stop);
pre.add(pause);
pre.add(quit);
pre.add(minimize);
pre.add(maximize);
JMenuItem j1 = new JMenuItem("Play");
JMenuItem j2 = new JMenuItem("Stop");
JMenuItem j3 = new JMenuItem("Pause");
JMenu playstop = new JMenu("Play/Stop");
playstop.add(j1);
playstop.add(j2);
playstop.add(j3);
pre.add(playstop);
JMenuItem j4 = new JMenuItem("Choose Mowie");
JMenuItem j5 = new JMenuitem("Formats");
j5.addActionListener(this);
JMenu mowie = new JMenu("Mowie");
mowie.add(j4);
mowie.add(j5);
pre.add(mowie);
JMenuItem j7 = new JMenuItem("Sound");
j7.addActionListener(this);
JMenuItem j8 = new JMenuItem("Gamma")
j8.addActionListener(this);
JMenu options = new JMenu("Options");
options.add(j7);
options.add(j8);
pre.add(options);
JMenuItem j9 = new JMenuItem("Quit");
j9.addActionListener(this);
JMenuItem j10 = new JMenuItem("Minimize");
JMenu quit = new JMenu("Quit");
quit.add(j9);
quit.add(j10);
pre.add(quit);
add(pre);
setSize(600,300);
setVisible(true);
}
public Sound() {
super("Sound options");
setDefaultCloseOperation(JFrame.EXIT.ON.CLOSE);
JButton ok = new JButton("Ok");
ok.addActionListener(this);
FlowLayout tzu = new FlowLayout(FlowLayout.LEFT);
setLayout(tzu);
JPanel sde = new JPanel();
JSlider sounde = new JSlider(JSlider.HORIZONTAL, 0, 20, 0);
sound.setMajorTickSpacing(10);
sound.setMinorTickSpacing(1);
sound.setPaintTicks(true);
sound.setPaintLabels(true);
sde.add(ok);
sde.add(sounde);
add(sde);
setVisible(true);
}
public Gamma() {
super("Gamma Options");
setDefaultCloseOperation(JFrame.EXIT.ON.CLOSE);
JButton oke = new JButton("OK");
oke.addActionListener(this);
FlowLayout tzi = new FlowLayout(FlowLayout.LEFT);
setLayout(tzi);
JPanel ske = new JPanel();
JSlider gammer = new JSlider(JSlider.HORIZONTAL, 0, 6, 0);
gammer.setMajorTickSpacing(3);
gammer.setMinorTickSpacing(1);
gammer.setPaintTicks(true);
gammer.setPaintLabels(true);
ske.add(oke);
ske.add(gammer);
add(ske);
setVisible(true);
}
public static void main(String[] arguments) {
OselPlayer ise = new OselPlayer();
}
public void actionPerformed(ActionEvent event) {
Object source = event.getSource();
if (source == quit) {
system.exit(0);
}if (source == minimize); {
pre.setSize(300,200);
repaint();
}if (source == maximize); {
pre.setSize(1200,800);
repaint();
}if (source == j7); {
Sound gtz = new Sound();
}if (source == j8); {
Gamma gdr = new Gamma();
}if (source == ok); {
system.exit(0);
}if (source == oke); {
system.exit(0);
}if (source == j5); {
int response;
response = JOptionPane.show.ConfirmDialog(null,
"You can watch all mowies in all formats",
"Formats", JOptionPane.YES_NO_OPTION,
JOptionPane.MessageDialog);
}if (source == j9); {
system.exit();
}
}
Könnt ihr mir bitte sagen was hier Falsch ist?