2 changed files with 84 additions and 0 deletions
Split View
Diff Options
@ -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.JLabel; |
|||
import java.awt.Font; |
|||
import javax.swing.JTextField; |
|||
import javax.swing.JButton; |
|||
import javax.swing.JComboBox; |
|||
import javax.swing.DefaultComboBoxModel; |
|||
import java.awt.event.ActionListener; |
|||
import java.awt.event.ActionEvent; |
|||
|
|||
public class TopMovieFrame extends JFrame { |
|||
|
|||
private JPanel contentPane; |
|||
|
|||
/** |
|||
* Launch the application. |
|||
*/ |
|||
public static void main(String[] args) { |
|||
EventQueue.invokeLater(new Runnable() { |
|||
public void run() { |
|||
try { |
|||
TopMovieFrame frame = new TopMovieFrame(); |
|||
frame.setVisible(true); |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Create the frame. |
|||
*/ |
|||
public TopMovieFrame() { |
|||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|||
setBounds(100, 100, 467, 333); |
|||
contentPane = new JPanel(); |
|||
contentPane.setBackground(new Color(0, 0, 51)); |
|||
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); |
|||
setContentPane(contentPane); |
|||
contentPane.setLayout(null); |
|||
|
|||
JLabel lblSelectGenre = new JLabel("Select Genre :"); |
|||
lblSelectGenre.setForeground(Color.WHITE); |
|||
lblSelectGenre.setFont(new Font("Tahoma", Font.PLAIN, 14)); |
|||
lblSelectGenre.setBounds(116, 45, 162, 24); |
|||
contentPane.add(lblSelectGenre); |
|||
|
|||
JComboBox comboBox = new JComboBox(); |
|||
comboBox.setModel(new DefaultComboBoxModel(new String[] {"", "Comic", "Horror", "Comedy", "Drama", "Action", "Thriller"})); |
|||
comboBox.setToolTipText(""); |
|||
comboBox.setBounds(107, 100, 171, 22); |
|||
contentPane.add(comboBox); |
|||
|
|||
JButton btnOkTmg = new JButton("ok"); |
|||
btnOkTmg.addActionListener(new ActionListener() { |
|||
public void actionPerformed(ActionEvent e) { |
|||
String genre=comboBox.getToolTipText().toString(); |
|||
Database.findTopMovieByGenre(genre); |
|||
|
|||
} |
|||
}); |
|||
btnOkTmg.setBounds(118, 154, 89, 23); |
|||
contentPane.add(btnOkTmg); |
|||
|
|||
|
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue