A voir également:
- Placement fenêtre JAVA 2
- Waptrick java football - Télécharger - Jeux vidéo
- Jeux java itel - Télécharger - Jeux vidéo
- Supercopier 2 - Télécharger - Gestion de fichiers
- Eclipse java - Télécharger - Langages
- Java apk - Télécharger - Langages
4 réponses
Salut !
Le code suivant marche très bien...
public class Fenetre extends javax.swing.JFrame {
public Fenetre() {
// Initialisation des composants...
//...
// Centrage de la fenetre
java.awt.GraphicsEnvironment graphicsEnvironment =
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment();
int x = graphicsEnvironment.getCenterPoint().x - getWidth() / 2;
int y = graphicsEnvironment.getCenterPoint().y - getHeight() / 2;
setLocation(x,y);
show();
} // Fin constructeur
} // Fin classe
A+
Si à gauche j'ai l'amont, c'est bon...
Si à gauche j'ai l'aval, j'suis bancal...
Le code suivant marche très bien...
public class Fenetre extends javax.swing.JFrame {
public Fenetre() {
// Initialisation des composants...
//...
// Centrage de la fenetre
java.awt.GraphicsEnvironment graphicsEnvironment =
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment();
int x = graphicsEnvironment.getCenterPoint().x - getWidth() / 2;
int y = graphicsEnvironment.getCenterPoint().y - getHeight() / 2;
setLocation(x,y);
show();
} // Fin constructeur
} // Fin classe
A+
Si à gauche j'ai l'amont, c'est bon...
Si à gauche j'ai l'aval, j'suis bancal...
Juste un truc : il me semble que ce n'est possible de faire ça qu'à partir de la version 1.4 de java... A priori, si tu utilises la 1.4.1 ou la 1.4.2, y a pas de pb...
A+
Si à gauche j'ai l'amont, c'est bon...
Si à gauche j'ai l'aval, j'suis bancal...
A+
Si à gauche j'ai l'amont, c'est bon...
Si à gauche j'ai l'aval, j'suis bancal...
Si à gauche j'ai l'amont, c'est bon...
Si à gauche j'ai l'aval, j'suis bancal...