71 lines
1.9 KiB
Java
71 lines
1.9 KiB
Java
package fr.blankoworld.ihm;
|
|
|
|
import java.awt.BorderLayout;
|
|
import java.awt.Dimension;
|
|
import java.awt.Insets;
|
|
|
|
import javax.swing.JButton;
|
|
import javax.swing.JFrame;
|
|
import javax.swing.JLabel;
|
|
import javax.swing.JPanel;
|
|
import javax.swing.JScrollPane;
|
|
import javax.swing.JTextPane;
|
|
|
|
|
|
public class IHMRequete extends JFrame {
|
|
// Requis par la classe JFrame (ne pas demander pourquoi)
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
// Creation de la zone de texte
|
|
private JTextPane panneauTexte;
|
|
|
|
/**
|
|
* @param args
|
|
*/
|
|
public static void main(String[] args) {
|
|
// TODO Auto-generated method stub
|
|
new IHMRequete().setVisible(true);
|
|
}
|
|
|
|
public IHMRequete(){
|
|
// Creation d'une etiquette
|
|
JLabel jRequete = new JLabel("Entrez votre requete : ");
|
|
|
|
// Creation des boutons
|
|
JButton jOk = new JButton("Ok");
|
|
JButton jAnnuler = new JButton("Annuler");
|
|
|
|
// Creation de la zone de texte
|
|
panneauTexte = new JTextPane();
|
|
panneauTexte.setCaretPosition(0);
|
|
panneauTexte.setMargin(new Insets(5,5,5,5));
|
|
JScrollPane zoneTexteRequete = new JScrollPane(panneauTexte);
|
|
zoneTexteRequete.setPreferredSize(new Dimension(200, 130));
|
|
|
|
// Creation des panneaux bas et centre
|
|
JPanel Panneau_Bas = new JPanel();
|
|
JPanel Panneau_Centre = new JPanel();
|
|
Panneau_Centre.setLayout(new BorderLayout());
|
|
|
|
// Ajout des boutons a chacun des panneaux
|
|
Panneau_Centre.add(jRequete, BorderLayout.NORTH);
|
|
Panneau_Centre.add(zoneTexteRequete, BorderLayout.CENTER);
|
|
|
|
Panneau_Bas.add(jOk);
|
|
Panneau_Bas.add(jAnnuler);
|
|
|
|
// Gestionnaire de contenus
|
|
this.getContentPane().setLayout(new BorderLayout());
|
|
this.add(Panneau_Centre, BorderLayout.CENTER);
|
|
this.add(Panneau_Bas, BorderLayout.SOUTH);
|
|
|
|
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
|
|
this.setSize(400,200);
|
|
this.setLocation(200,200);
|
|
this.setResizable(false);
|
|
this.setTitle("Requete");
|
|
|
|
}
|
|
}
|