|
|
@ -0,0 +1,74 @@ |
|
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
|
import java.awt.EventQueue; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.JFrame; |
|
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
|
import javax.swing.border.EmptyBorder; |
|
|
|
|
|
import java.awt.Color; |
|
|
|
|
|
import javax.swing.JButton; |
|
|
|
|
|
import javax.swing.JTextField; |
|
|
|
|
|
import javax.swing.JLabel; |
|
|
|
|
|
import javax.swing.JOptionPane; |
|
|
|
|
|
|
|
|
|
|
|
import java.awt.Font; |
|
|
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
|
|
|
|
|
|
|
public class WatchMovieFrame extends JFrame { |
|
|
|
|
|
|
|
|
|
|
|
private JPanel contentPane; |
|
|
|
|
|
private JTextField tf_mid_wm; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Launch the application. |
|
|
|
|
|
*/ |
|
|
|
|
|
/*public static void main(String[] args) { |
|
|
|
|
|
EventQueue.invokeLater(new Runnable() { |
|
|
|
|
|
public void run() { |
|
|
|
|
|
try { |
|
|
|
|
|
WatchMovieFrame frame = new WatchMovieFrame(); |
|
|
|
|
|
frame.setVisible(true); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
*/ |
|
|
|
|
|
/** |
|
|
|
|
|
* Create the frame. |
|
|
|
|
|
*/ |
|
|
|
|
|
public WatchMovieFrame() { |
|
|
|
|
|
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
|
|
|
|
setBounds(100, 100, 450, 300); |
|
|
|
|
|
contentPane = new JPanel(); |
|
|
|
|
|
contentPane.setBackground(new Color(0, 0, 51)); |
|
|
|
|
|
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); |
|
|
|
|
|
setContentPane(contentPane); |
|
|
|
|
|
contentPane.setLayout(null); |
|
|
|
|
|
|
|
|
|
|
|
JButton btnOkWm = new JButton("ok"); |
|
|
|
|
|
btnOkWm.addActionListener(new ActionListener() { |
|
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
|
Database.incNumWatched(Integer.parseInt(tf_mid_wm.getText())); |
|
|
|
|
|
JOptionPane.showMessageDialog(null, "Movie Watch Number of Times Incremented successfully..."); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
btnOkWm.setBounds(61, 157, 89, 23); |
|
|
|
|
|
contentPane.add(btnOkWm); |
|
|
|
|
|
|
|
|
|
|
|
tf_mid_wm = new JTextField(); |
|
|
|
|
|
tf_mid_wm.setColumns(10); |
|
|
|
|
|
tf_mid_wm.setBounds(59, 86, 210, 24); |
|
|
|
|
|
contentPane.add(tf_mid_wm); |
|
|
|
|
|
|
|
|
|
|
|
JLabel lblEnterMovieId = new JLabel("Enter Movie Id:"); |
|
|
|
|
|
lblEnterMovieId.setForeground(Color.WHITE); |
|
|
|
|
|
lblEnterMovieId.setFont(new Font("Tahoma", Font.PLAIN, 14)); |
|
|
|
|
|
lblEnterMovieId.setBounds(59, 48, 162, 24); |
|
|
|
|
|
contentPane.add(lblEnterMovieId); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |