Changement version tmdbAPI v11
This commit is contained in:
parent
18c3c0a2dd
commit
a56a4239b0
|
|
@ -8,6 +8,6 @@
|
|||
<classpathentry kind="lib" path="lib/okio-2.4.3.jar"/>
|
||||
<classpathentry kind="lib" path="lib/retrofit-2.7.2.jar"/>
|
||||
<classpathentry kind="lib" path="lib/converter-gson-2.0.0-beta3.jar"/>
|
||||
<classpathentry kind="lib" path="lib/tmdbapiv10.jar"/>
|
||||
<classpathentry kind="lib" path="lib/tmdbapiv11.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -14,6 +14,7 @@ import javax.swing.JButton;
|
|||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.ActionEvent;
|
||||
import javax.swing.JTextField;
|
||||
import java.awt.GridLayout;
|
||||
|
||||
public class MaJFrame extends JFrame implements TMDBAPICallBack {
|
||||
|
||||
|
|
@ -22,6 +23,9 @@ public class MaJFrame extends JFrame implements TMDBAPICallBack {
|
|||
private JButton btnNewButton;
|
||||
private JTextField textField;
|
||||
private TMDBAPI api=null;
|
||||
private JTextField textField_1;
|
||||
private JPanel panel_1;
|
||||
private JPanelImage panel_im_2;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -29,7 +33,7 @@ public class MaJFrame extends JFrame implements TMDBAPICallBack {
|
|||
*/
|
||||
public MaJFrame() {
|
||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
setBounds(100, 100, 300, 450);
|
||||
setBounds(100, 100, 500, 500);
|
||||
contentPane = new JPanel();
|
||||
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
|
||||
contentPane.setLayout(new BorderLayout(0, 0));
|
||||
|
|
@ -38,7 +42,7 @@ public class MaJFrame extends JFrame implements TMDBAPICallBack {
|
|||
JPanel panel = new JPanel();
|
||||
contentPane.add(panel, BorderLayout.NORTH);
|
||||
|
||||
btnNewButton = new JButton("Film");
|
||||
btnNewButton = new JButton("get Films");
|
||||
btnNewButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
clicBouton();
|
||||
|
|
@ -49,10 +53,22 @@ public class MaJFrame extends JFrame implements TMDBAPICallBack {
|
|||
textField.setText("550");
|
||||
panel.add(textField);
|
||||
textField.setColumns(5);
|
||||
|
||||
textField_1 = new JTextField();
|
||||
textField_1.setText("650");
|
||||
panel.add(textField_1);
|
||||
textField_1.setColumns(5);
|
||||
panel.add(btnNewButton);
|
||||
|
||||
panel_1 = new JPanel();
|
||||
contentPane.add(panel_1, BorderLayout.CENTER);
|
||||
panel_1.setLayout(new GridLayout(0, 2, 0, 0));
|
||||
|
||||
panel_im = new JPanelImage();
|
||||
contentPane.add(panel_im, BorderLayout.CENTER);
|
||||
panel_1.add(panel_im);
|
||||
|
||||
panel_im_2 = new JPanelImage();
|
||||
panel_1.add(panel_im_2);
|
||||
|
||||
api = new TMDBAPI(this);
|
||||
}
|
||||
|
|
@ -60,13 +76,18 @@ public class MaJFrame extends JFrame implements TMDBAPICallBack {
|
|||
protected void clicBouton() {
|
||||
int idFilm=550;
|
||||
if (textField.getText().length()>1) idFilm = Integer.parseInt(textField.getText());
|
||||
if (api!=null) api.getFilm(idFilm);
|
||||
if (api!=null) api.getFilm(idFilm,1);
|
||||
|
||||
idFilm=650;
|
||||
if (textField_1.getText().length()>1) idFilm = Integer.parseInt(textField_1.getText());
|
||||
if (api!=null) api.getFilm(idFilm,2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void retourAPI(TMDBFilm theMovie) {
|
||||
public void retourAPI(TMDBFilm theMovie,int numCB) {
|
||||
if (theMovie!=null) {
|
||||
panel_im.setImage(theMovie.getPoster_image());
|
||||
if (numCB==1) panel_im.setImage(theMovie.getPoster_image());
|
||||
if (numCB==2) panel_im_2.setImage(theMovie.getPoster_image());
|
||||
}
|
||||
this.repaint();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue