Skip to content

Commit 3f5bd3e

Browse files
committed
fixed bug in main page where jlabel did not appear for user with no flashcard sets
1 parent db06ee5 commit 3f5bd3e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/java/MainPage/HomePage.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,14 @@ public HomePage(UserLoginResponseModel user) throws IOException {
7474
Map<Integer, String[]> idsToFlashcardSetData = user.getFlashcardSets();
7575

7676
int numSets = idsToFlashcardSetData.size();
77+
System.out.println(numSets);
7778
if (numSets==0){
78-
this.add(new JLabel("You have no Flashcard Sets!"));
79+
JLabel label = new JLabel("You have no Flashcard Sets!");
80+
label.setHorizontalAlignment(SwingConstants.CENTER);
81+
label.setVerticalAlignment(SwingConstants.TOP);
82+
JPanel labelPanel = new JPanel();
83+
labelPanel.add(label);
84+
this.add(labelPanel);
7985
}
8086
else {
8187
this.add(new ListOfFlashcardSetsDataPanel(idsToFlashcardSetData, gateway, true));

0 commit comments

Comments
 (0)