PlayJPanel.java
938 Bytes
import java.awt.BorderLayout;
import java.awt.Font;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class PlayJPanel extends JPanel {
private static final long serialVersionUID = 1L;
private static final Font titleFont = new Font(new JLabel().getFont().getName(), Font.BOLD, 14);
public PlayJPanel(Interface interf, LightCanvasJPanel lightCanvas) {
super(new BorderLayout());
// title
JLabel title = new JLabel("Visualizer :");
title.setFont(titleFont);
add(title, BorderLayout.NORTH);
// lights
JPanel centerPanel = new JPanel();
centerPanel.setLayout(new BoxLayout(centerPanel, BoxLayout.LINE_AXIS));
centerPanel.add(Box.createHorizontalGlue());
centerPanel.add(lightCanvas);
add(centerPanel, BorderLayout.CENTER);
// controls
interf.animPlayer = new AnimationPlayer(interf);
add(interf.animPlayer, BorderLayout.SOUTH);
}
}