You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
92 lines
2.3 KiB
92 lines
2.3 KiB
import java.awt.BorderLayout;
|
|
import java.awt.EventQueue;
|
|
|
|
import javax.swing.JFrame;
|
|
import javax.swing.JPanel;
|
|
import javax.swing.border.EmptyBorder;
|
|
import java.awt.GridLayout;
|
|
import javax.swing.JButton;
|
|
import java.awt.Color;
|
|
import java.awt.event.ActionListener;
|
|
import java.awt.event.ActionEvent;
|
|
|
|
public class Main_HomePage extends JFrame {
|
|
|
|
private JPanel contentPane;
|
|
|
|
/**
|
|
* Create the frame.
|
|
*/
|
|
public Main_HomePage() {
|
|
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
setBounds(100, 100, 271, 358);
|
|
contentPane = new JPanel();
|
|
contentPane.setBackground(new Color(0, 0, 51));
|
|
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
|
|
setContentPane(contentPane);
|
|
contentPane.setLayout(null);
|
|
|
|
JPanel panel = new JPanel();
|
|
panel.setBackground(new Color(0, 0, 51));
|
|
panel.setBounds(50, 31, 155, 249);
|
|
contentPane.add(panel);
|
|
panel.setLayout(null);
|
|
|
|
JButton btnMovies = new JButton("Movie");
|
|
btnMovies.addActionListener(new ActionListener() {
|
|
public void actionPerformed(ActionEvent e) {
|
|
Movies m=new Movies();
|
|
m.setVisible(true);
|
|
if(m.isVisible()) {
|
|
//use to display only one screen
|
|
Main_HomePage.this.dispose();
|
|
}
|
|
}
|
|
});
|
|
btnMovies.setBounds(27, 41, 89, 23);
|
|
panel.add(btnMovies);
|
|
|
|
JButton btnStar = new JButton("Star");
|
|
btnStar.addActionListener(new ActionListener() {
|
|
public void actionPerformed(ActionEvent e) {
|
|
Star s=new Star();
|
|
s.setVisible(true);
|
|
if(s.isVisible()) {
|
|
//use to display only one screen
|
|
Main_HomePage.this.dispose();
|
|
}
|
|
}
|
|
});
|
|
btnStar.setBounds(27, 90, 89, 23);
|
|
panel.add(btnStar);
|
|
|
|
JButton btnRatings = new JButton("Ratings");
|
|
btnRatings.addActionListener(new ActionListener() {
|
|
public void actionPerformed(ActionEvent e) {
|
|
Ratings r=new Ratings();
|
|
r.setVisible(true);
|
|
if(r.isVisible()) {
|
|
//use to display only one screen
|
|
Main_HomePage.this.dispose();
|
|
}
|
|
}
|
|
|
|
});
|
|
btnRatings.setBounds(27, 145, 89, 23);
|
|
panel.add(btnRatings);
|
|
|
|
JButton btnLogout = new JButton("Logout");
|
|
btnLogout.addActionListener(new ActionListener() {
|
|
public void actionPerformed(ActionEvent e) {
|
|
LoginFrame lf=new LoginFrame();
|
|
lf.setVisible(true);
|
|
if(lf.isVisible()) {
|
|
//use to display only one screen
|
|
Main_HomePage.this.dispose();
|
|
}
|
|
}
|
|
});
|
|
btnLogout.setBounds(27, 198, 89, 23);
|
|
panel.add(btnLogout);
|
|
}
|
|
}
|