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