2 changed files with 158 additions and 0 deletions
Unified View
Diff Options
@ -0,0 +1,77 @@ |
|||||
|
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 java.awt.event.ActionListener; |
||||
|
import java.awt.event.ActionEvent; |
||||
|
|
||||
|
public class ShowMovieFrame extends JFrame { |
||||
|
|
||||
|
private JPanel contentPane; |
||||
|
private JTextField tf_mt_sm; |
||||
|
Database db=new Database(); |
||||
|
|
||||
|
/** |
||||
|
* Launch the application. |
||||
|
*/ |
||||
|
public static void main(String[] args) { |
||||
|
EventQueue.invokeLater(new Runnable() { |
||||
|
public void run() { |
||||
|
try { |
||||
|
ShowMovieFrame frame = new ShowMovieFrame(); |
||||
|
frame.setVisible(true); |
||||
|
} catch (Exception e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Create the frame. |
||||
|
*/ |
||||
|
public ShowMovieFrame() { |
||||
|
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 Movie Title:"); |
||||
|
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_mt_sm = new JTextField(); |
||||
|
tf_mt_sm.setBounds(66, 129, 210, 24); |
||||
|
contentPane.add(tf_mt_sm); |
||||
|
tf_mt_sm.setColumns(10); |
||||
|
|
||||
|
JButton btnOkSM = new JButton("ok"); |
||||
|
btnOkSM.addActionListener(new ActionListener() { |
||||
|
public void actionPerformed(ActionEvent e) { |
||||
|
int found = db.findMovieId(tf_mt_sm.getText()); |
||||
|
if(found==1) { |
||||
|
JOptionPane.showMessageDialog(null, "Title Found!"); |
||||
|
} |
||||
|
else { |
||||
|
JOptionPane.showMessageDialog(null, "Title not found !!"); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
btnOkSM.setBounds(68, 200, 89, 23); |
||||
|
contentPane.add(btnOkSM); |
||||
|
} |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue