Code:
import javax.swing.*;
import java.awt.*;
public class Playback extends JFrame {
public Playback(){
super();
setTitle("Playback");
setLookAndFeel();
// setSize(225, 80);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
FlowLayout flo = new FlowLayout();
setLayout(flo);
JButton play = new JButton("Play");
JButton stop = new JButton("Stop");
JButton pause = new JButton("Pause");
add(play);
add(stop);
add(pause);
setVisible(true);
}
private void setLookAndFeel() {
try {
UIManager.setLookAndFeel(
"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
}catch (Exception exc) {
// ignore error
}
}
public static void main(String[] args) {
Playback pb = new Playback();
pb.pack();
}
}
To run this code and get a result pic in blow:
Thinking:
To study a Gui, you will find more Gui is the same method to use.