Browse Source

Added GridBagConstraints and GridBagLayout

master
Leon Montag 2 years ago
parent
commit
ba50d3fea4
  1. 6
      src/main/java/Gui/GameGui.java

6
src/main/java/Gui/GameGui.java

@ -1,6 +1,8 @@
package Gui; package Gui;
import java.awt.Font; import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout; import java.awt.GridLayout;
import javax.swing.JLabel; import javax.swing.JLabel;
@ -11,6 +13,7 @@ public class GameGui {
public static JPanel MainPanel, ButtonPanel, headingPanel; public static JPanel MainPanel, ButtonPanel, headingPanel;
public static JLabel Headline,QuestionLabel; public static JLabel Headline,QuestionLabel;
GridLayout grid; GridLayout grid;
GridBagConstraints gbc;
public void createGui() { public void createGui() {
@ -31,5 +34,8 @@ GridLayout grid;
QuestionLabel.setHorizontalAlignment(JLabel.CENTER); QuestionLabel.setHorizontalAlignment(JLabel.CENTER);
QuestionLabel.setVerticalAlignment(JLabel.NORTH); QuestionLabel.setVerticalAlignment(JLabel.NORTH);
headingPanel.add(QuestionLabel); headingPanel.add(QuestionLabel);
ButtonPanel.setLayout(new GridBagLayout());
gbc = new GridBagConstraints();
} }
} }
Loading…
Cancel
Save