mirror of
https://github.com/guezoloic/racing-game.git
synced 2026-03-29 02:13:46 +00:00
fix: ajout layout dans class parent
This commit is contained in:
@@ -33,11 +33,6 @@ public class Dashboard extends GameView
|
|||||||
|
|
||||||
init(fn);
|
init(fn);
|
||||||
|
|
||||||
// mettre un layout (text au centre et bouton en bas)
|
|
||||||
// this.setLayout(new BorderLayout());
|
|
||||||
// this.add(label, BorderLayout.CENTER);
|
|
||||||
// this.add(button, BorderLayout.SOUTH);
|
|
||||||
this.setLayout(new BorderLayout());
|
|
||||||
this.add(label, BorderLayout.CENTER);
|
this.add(label, BorderLayout.CENTER);
|
||||||
this.add(button, BorderLayout.SOUTH);
|
this.add(button, BorderLayout.SOUTH);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import java.awt.BorderLayout;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
@@ -16,7 +17,6 @@ public abstract class GameView extends JComponent
|
|||||||
frame.setLocation(x, y);
|
frame.setLocation(x, y);
|
||||||
// taille fenetre
|
// taille fenetre
|
||||||
frame.setSize(width, height);
|
frame.setSize(width, height);
|
||||||
|
|
||||||
// bool pour resize la fenetre
|
// bool pour resize la fenetre
|
||||||
frame.setResizable(true);
|
frame.setResizable(true);
|
||||||
// le bouton close par defaut
|
// le bouton close par defaut
|
||||||
@@ -25,6 +25,8 @@ public abstract class GameView extends JComponent
|
|||||||
frame.setContentPane(this);
|
frame.setContentPane(this);
|
||||||
// visibilité de la fenetre
|
// visibilité de la fenetre
|
||||||
frame.setVisible(true);
|
frame.setVisible(true);
|
||||||
|
// mettre un layout
|
||||||
|
frame.setLayout(new BorderLayout());
|
||||||
register();
|
register();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,7 +46,6 @@ public abstract class GameView extends JComponent
|
|||||||
{
|
{
|
||||||
for (GameView o : vobs)
|
for (GameView o : vobs)
|
||||||
{
|
{
|
||||||
System.out.println(o.getClass());
|
|
||||||
o.run();
|
o.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user