4 Commits
41bb0edc05
...
34d370ab77
| Author | SHA1 | Message | Date |
|---|---|---|---|
|
|
34d370ab77 |
new code
|
3 years ago |
|
|
e2cba51792 |
updated
|
3 years ago |
|
|
4bfd86ab07 |
updated
|
3 years ago |
|
|
be91a2c74c |
updated
|
3 years ago |
19 changed files with 327 additions and 78 deletions
Unified View
Diff Options
-
BINFavorite_Movies/bin/Database.class
-
BINFavorite_Movies/bin/LoginFrame$1.class
-
BINFavorite_Movies/bin/LoginFrame.class
-
BINFavorite_Movies/bin/Main_HomePage$1.class
-
BINFavorite_Movies/bin/Main_HomePage$2.class
-
BINFavorite_Movies/bin/Main_HomePage$3.class
-
BINFavorite_Movies/bin/Main_HomePage$4.class
-
BINFavorite_Movies/bin/Main_HomePage.class
-
BINFavorite_Movies/bin/Star.class
-
159Favorite_Movies/src/Database.java
-
18Favorite_Movies/src/Main_HomePage.java
-
8Favorite_Movies/src/Movie.java
-
35Favorite_Movies/src/MoviesFrame.java
-
12Favorite_Movies/src/Rating.java
-
23Favorite_Movies/src/RatingsFrame.java
-
75Favorite_Movies/src/ShowMoviesForStarFrame.java
-
5Favorite_Movies/src/Star.java
-
35Favorite_Movies/src/StarsFrame.java
-
35Favorite_Movies/src/TopMovieFrame.java
@ -0,0 +1,75 @@ |
|||||
|
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 javax.swing.JOptionPane; |
||||
|
|
||||
|
import java.awt.Font; |
||||
|
import javax.swing.JTextField; |
||||
|
import javax.swing.JButton; |
||||
|
import javax.swing.JList; |
||||
|
import java.awt.event.ActionListener; |
||||
|
import java.util.ArrayList; |
||||
|
import java.awt.event.ActionEvent; |
||||
|
|
||||
|
public class ShowMoviesForStarFrame extends JFrame { |
||||
|
|
||||
|
private JPanel contentPane; |
||||
|
private JTextField tf_starName; |
||||
|
private JList lMovies; |
||||
|
|
||||
|
/** |
||||
|
* Create the frame. |
||||
|
*/ |
||||
|
public ShowMoviesForStarFrame() { |
||||
|
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
||||
|
setBounds(100, 100, 378, 375); |
||||
|
contentPane = new JPanel(); |
||||
|
contentPane.setBackground(new Color(0, 0, 51)); |
||||
|
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); |
||||
|
setContentPane(contentPane); |
||||
|
contentPane.setLayout(null); |
||||
|
|
||||
|
JLabel lblNewLabel = new JLabel("Enter Star Name:"); |
||||
|
lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 14)); |
||||
|
lblNewLabel.setForeground(new Color(255, 255, 255)); |
||||
|
lblNewLabel.setBounds(66, 91, 162, 24); |
||||
|
contentPane.add(lblNewLabel); |
||||
|
|
||||
|
tf_starName = new JTextField(); |
||||
|
tf_starName.setBounds(66, 129, 210, 24); |
||||
|
contentPane.add(tf_starName); |
||||
|
tf_starName.setColumns(10); |
||||
|
|
||||
|
lMovies = new JList(); |
||||
|
lMovies.setFont(new Font("Tahoma", Font.PLAIN, 14)); |
||||
|
lMovies.setForeground(new Color(255, 255, 255)); |
||||
|
lMovies.setBounds(66, 160, 210, 100); |
||||
|
contentPane.add(lMovies); |
||||
|
|
||||
|
|
||||
|
JButton btnOkSM = new JButton("ok"); |
||||
|
btnOkSM.addActionListener(new ActionListener() { |
||||
|
public void actionPerformed(ActionEvent e) { |
||||
|
ArrayList<Movie> movies = Database.findMoviesForStar(tf_starName.getText()); |
||||
|
if (movies.size()>0) |
||||
|
{ |
||||
|
JOptionPane.showMessageDialog(null, "Movies Found for Star!"); |
||||
|
for(Movie m: movies) |
||||
|
{ |
||||
|
lMovies.add(new JLabel(m.getTitle())); |
||||
|
} |
||||
|
} |
||||
|
else { |
||||
|
JOptionPane.showMessageDialog(null, "Title not found !!"); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
btnOkSM.setBounds(68, 300, 89, 23); |
||||
|
contentPane.add(btnOkSM); |
||||
|
} |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue