From 41bb0edc05174e44e7ac8192013e015669fb3b45 Mon Sep 17 00:00:00 2001 From: pooja Date: Fri, 27 May 2022 16:32:11 +0530 Subject: [PATCH] moviestarframe --- Favorite_Movies/src/MovieForStarFrame.java | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 Favorite_Movies/src/MovieForStarFrame.java diff --git a/Favorite_Movies/src/MovieForStarFrame.java b/Favorite_Movies/src/MovieForStarFrame.java new file mode 100644 index 0000000..5d3bd78 --- /dev/null +++ b/Favorite_Movies/src/MovieForStarFrame.java @@ -0,0 +1,70 @@ +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.JLabel; +import java.awt.Font; +import javax.swing.JTextField; +import javax.swing.JButton; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; + +public class MovieForStarFrame extends JFrame { + + private JPanel contentPane; + private JTextField tf_nS; + + /** + * Launch the application. + */ + public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + MovieForStarFrame frame = new MovieForStarFrame(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + + /** + * Create the frame. + */ + public MovieForStarFrame() { + 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); + + JLabel lblEnterNameOf = new JLabel("Enter Name of the Star:"); + lblEnterNameOf.setForeground(Color.WHITE); + lblEnterNameOf.setFont(new Font("Tahoma", Font.PLAIN, 14)); + lblEnterNameOf.setBounds(68, 50, 162, 24); + contentPane.add(lblEnterNameOf); + + tf_nS = new JTextField(); + tf_nS.setColumns(10); + tf_nS.setBounds(68, 88, 210, 24); + contentPane.add(tf_nS); + + JButton btnmfsf = new JButton("ok"); + btnmfsf.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + String starname=tf_nS.getText(); + Database.findMoviesForStar(starname); + } + }); + btnmfsf.setBounds(70, 159, 89, 23); + contentPane.add(btnmfsf); + } + +}