1 changed files with 98 additions and 0 deletions
Unified View
Diff Options
@ -0,0 +1,98 @@ |
|||||
|
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.SystemColor; |
||||
|
|
||||
|
import javax.imageio.ImageIO; |
||||
|
import javax.swing.ImageIcon; |
||||
|
import javax.swing.JButton; |
||||
|
import javax.swing.JTextField; |
||||
|
import java.awt.Font; |
||||
|
import java.awt.event.ActionListener; |
||||
|
import java.awt.image.BufferedImage; |
||||
|
import java.io.File; |
||||
|
import java.io.IOException; |
||||
|
import java.awt.event.ActionEvent; |
||||
|
|
||||
|
public class ShowPosterImageFrame extends JFrame { |
||||
|
|
||||
|
private JPanel contentPane; |
||||
|
private JTextField tf_mid_spi; |
||||
|
|
||||
|
/** |
||||
|
* Launch the application. |
||||
|
*/ |
||||
|
public static void main(String[] args) { |
||||
|
EventQueue.invokeLater(new Runnable() { |
||||
|
public void run() { |
||||
|
try { |
||||
|
ShowPosterImageFrame frame = new ShowPosterImageFrame(); |
||||
|
frame.setVisible(true); |
||||
|
} catch (Exception e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Create the frame. |
||||
|
*/ |
||||
|
public ShowPosterImageFrame() { |
||||
|
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
||||
|
setBounds(100, 100, 564, 414); |
||||
|
contentPane = new JPanel(); |
||||
|
contentPane.setBackground(new Color(0, 0, 51)); |
||||
|
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); |
||||
|
setContentPane(contentPane); |
||||
|
contentPane.setLayout(null); |
||||
|
|
||||
|
JPanel panel = new JPanel(); |
||||
|
panel.setBackground(new Color(0, 0, 51)); |
||||
|
panel.setBounds(10, 11, 528, 339); |
||||
|
contentPane.add(panel); |
||||
|
panel.setLayout(null); |
||||
|
|
||||
|
JLabel lblPoster = new JLabel("poster"); |
||||
|
lblPoster.setBounds(89, 160, 303, 150); |
||||
|
lblPoster.setBackground(SystemColor.menu); |
||||
|
panel.add(lblPoster); |
||||
|
|
||||
|
JButton btnOkSpi = new JButton("ok"); |
||||
|
btnOkSpi.addActionListener(new ActionListener() { |
||||
|
public void actionPerformed(ActionEvent e) { |
||||
|
|
||||
|
|
||||
|
try { |
||||
|
BufferedImage myPicture; |
||||
|
|
||||
|
myPicture = ImageIO.read(new File("C:\\Users\\skc\\eclipse-workspace\\first\\Favorite_Movies\\src\\images\\movies_poster\\Lion king\\81BMmrwSFOL.jpg")); |
||||
|
JLabel picLabel = new JLabel(new ImageIcon(myPicture)); |
||||
|
add(picLabel); |
||||
|
} catch (IOException e1) { |
||||
|
// TODO Auto-generated catch block |
||||
|
e1.printStackTrace(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
}); |
||||
|
btnOkSpi.setBounds(343, 11, 89, 23); |
||||
|
panel.add(btnOkSpi); |
||||
|
|
||||
|
tf_mid_spi = new JTextField(); |
||||
|
tf_mid_spi.setBounds(177, 12, 129, 20); |
||||
|
panel.add(tf_mid_spi); |
||||
|
tf_mid_spi.setColumns(10); |
||||
|
|
||||
|
JLabel lblNewLabel = new JLabel("Enter Movie ID:"); |
||||
|
lblNewLabel.setForeground(new Color(255, 255, 255)); |
||||
|
lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 16)); |
||||
|
lblNewLabel.setBounds(27, 15, 129, 14); |
||||
|
panel.add(lblNewLabel); |
||||
|
} |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue