JComponents arent displayed properly unless the window is minimized and reopened

I just want an answer and want to make this program work

Be very careful what you wish for...

The following makes use of the following concepts...

  • Creating a GUI With Swing
  • Laying Out Components Within a Container* How to Use CardLayout
  • Dependency Injection in Java
  • Observer Pattern

The example is also incomplete and you're going to need to take the time to understand the above concepts in order to fill out the missing parts

I also think you're going to want to have a look at How to Use Tables at some point.

import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

public class Test {

    public static void main(String[] args) {
        new Test();
    }

    public Test() {
        EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                JFrame frame = new JFrame();
                frame.add(new NavigationPane());
                frame.pack();
                frame.setLocationRelativeTo(null);
                frame.setVisible(true);
            }
        });
    }

    public static class Support {
        public static final Font TITLE_FONT = new Font("Lucida Handwriting", Font.PLAIN, 70);
        public static final Font NORMAL_FONT = new Font("Lucida Handwriting", Font.PLAIN, 18);
        public static final Font SMALL_FONT = new Font("Lucida Handwriting", Font.PLAIN, 18);
    }

    public class NavigationPane extends JPanel {

        protected enum View {
            MAIN, CHOICE, NOTES, TASKS;
        }

        private CardLayout cardLayout;

        public NavigationPane() {
            cardLayout = new CardLayout();
            setLayout(cardLayout);

            add(new MainPane(new MainPane.Observer() {
                @Override
                public void navigateToChoices(MainPane source) {
                    navigateTo(View.CHOICE);
                }
            }), View.MAIN);

            add(new ChoicePane(new ChoicePane.Observer() {
                @Override
                public void navigateToTasks(ChoicePane source) {
                    navigateTo(View.TASKS);
                }

                @Override
                public void navigateToNotes(ChoicePane source) {
                    navigateTo(View.NOTES);
                }
            }), View.CHOICE);

            add(new TasksPane(), View.TASKS);
            add(new NotesPane(), View.NOTES);

            navigateTo(View.MAIN);
        }

        protected void navigateTo(View view) {
            cardLayout.show(this, view.name());
        }

        // Because I'm lazy
        protected void add(Component comp, View view) {
            super.add(comp, view.name());
        }

    }

    public class MainPane extends JPanel {

        public interface Observer {
            public void navigateToChoices(MainPane source);
        }

        private Observer observer;

        public MainPane(Observer observer) {
            this.observer = observer;
            setBorder(new EmptyBorder(32, 32, 32, 32));
            setBackground(new Color(4, 102, 69));
            setLayout(new GridBagLayout());

            JLabel todayLabel = new JLabel("Today is " + DateTimeFormatter.ISO_LOCAL_DATE.format(LocalDate.now()));
            todayLabel.setFont(Support.NORMAL_FONT);
            todayLabel.setForeground(new Color(135, 233, 169));
            todayLabel.setBackground(new Color(14, 21, 7));
            todayLabel.setOpaque(true);
            todayLabel.setBorder(new EmptyBorder(16, 16, 16, 16));

            JLabel titleLabel = new JLabel("Daily Planner");
            titleLabel.setFont(Support.TITLE_FONT);
            titleLabel.setBackground(new Color(135, 233, 169));
            titleLabel.setOpaque(true);
            titleLabel.setBorder(new EmptyBorder(32, 32, 32, 32));

            JButton clickHereButton = new JButton("Click Here");
            clickHereButton.setFont(Support.SMALL_FONT);

            clickHereButton.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    observer.navigateToChoices(MainPane.this);
                }
            });

            GridBagConstraints gbc = new GridBagConstraints();
            gbc.gridy = 0;
            gbc.gridwidth = gbc.REMAINDER;
            gbc.insets = new Insets(8, 8, 32, 8);            
            add(todayLabel, gbc);

            gbc.gridy++;
            gbc.insets = new Insets(0, 8, 32, 8);
            add(titleLabel, gbc);

            gbc.gridy++;
            gbc.insets = new Insets(0, 8, 8, 8);
            add(clickHereButton, gbc);
        }

    }

    public class ChoicePane extends JPanel {

        public interface Observer {
            public void navigateToTasks(ChoicePane source);
            public void navigateToNotes(ChoicePane source);
        }

        private Observer observer;

        public ChoicePane(Observer observer) {
            this.observer = observer;
            setBorder(new EmptyBorder(32, 32, 32, 32));
            setBackground(new Color(4, 102, 69));
            setLayout(new GridLayout(1, 2, 8, 8));

            JButton tasksButton = new JButton("TASKS");
            tasksButton.setOpaque(true);
            tasksButton.setBorderPainted(false);
            tasksButton.setBackground(new Color(63, 194, 131));
            tasksButton.setFont(Support.TITLE_FONT); //reused the "titleFont" font 
            tasksButton.setForeground(Color.white);
            tasksButton.setFocusPainted(false);
            tasksButton.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    observer.navigateToTasks(ChoicePane.this);
                }
            });

            JButton notesButton = new JButton("NOTES");
            notesButton.setOpaque(true);
            notesButton.setBorderPainted(false);
            notesButton.setBackground(new Color(63, 194, 131));
            notesButton.setFont(Support.TITLE_FONT);
            notesButton.setForeground(Color.white);
            notesButton.setFocusPainted(false);
            notesButton.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    observer.navigateToNotes(ChoicePane.this);
                }
            });

            add(tasksButton);
            add(notesButton);
        }

    }

    public class TasksPane extends JPanel {

        public TasksPane() {
            setBorder(new EmptyBorder(32, 32, 32, 32));
            setBackground(new Color(4, 102, 69));
            setLayout(new BorderLayout(8, 8));

            JPanel titlePane = new JPanel(new GridBagLayout());
            titlePane.setOpaque(false);

            JLabel titleLabel = new JLabel("Tasks");
            titleLabel.setBackground(new Color(4, 102, 69));
            titleLabel.setForeground(Color.WHITE);
            titleLabel.setFont(Support.SMALL_FONT);

            JButton addButton = new JButton("+");
            addButton.setBorderPainted(false);
            addButton.setFocusPainted(false);
            addButton.setBackground(new Color(63, 194, 131));
            addButton.setForeground(Color.white);
            addButton.setFont(Support.SMALL_FONT);
            addButton.setOpaque(true);

            GridBagConstraints gbc = new GridBagConstraints();
            gbc.gridx = 0;
            gbc.gridy = 0;
            gbc.weightx = 1;
            gbc.anchor = gbc.LINE_START;
            titlePane.add(titleLabel, gbc);
            gbc.weightx = 0;
            gbc.gridx++;
            titlePane.add(addButton, gbc);

            add(titlePane, BorderLayout.NORTH);

            // Personally, I think you need a JTable
            JPanel fillerPane = new JPanel();
            fillerPane.setBackground(new Color(6, 122, 76));
            add(fillerPane);
        }

    }

    public class NotesPane extends JPanel {

        public NotesPane() {
            setBorder(new EmptyBorder(32, 32, 32, 32));
            setBackground(new Color(4, 102, 69));
            setLayout(new BorderLayout(8, 8));

            JPanel titlePane = new JPanel(new GridBagLayout());
            titlePane.setOpaque(false);

            JLabel titleLabel = new JLabel("Notes");
            titleLabel.setBackground(new Color(4, 102, 69));
            titleLabel.setForeground(Color.WHITE);
            titleLabel.setFont(Support.SMALL_FONT);

            JButton addButton = new JButton("+");
            addButton.setBorderPainted(false);
            addButton.setFocusPainted(false);
            addButton.setBackground(new Color(63, 194, 131));
            addButton.setForeground(Color.white);
            addButton.setFont(Support.SMALL_FONT);
            addButton.setOpaque(true);

            GridBagConstraints gbc = new GridBagConstraints();
            gbc.gridx = 0;
            gbc.gridy = 0;
            gbc.weightx = 1;
            gbc.anchor = gbc.LINE_START;
            titlePane.add(titleLabel, gbc);
            gbc.weightx = 0;
            gbc.gridx++;
            titlePane.add(addButton, gbc);

            add(titlePane, BorderLayout.NORTH);

            // Personally, I think you need a JTable
            JPanel fillerPane = new JPanel();
            fillerPane.setBackground(new Color(6, 122, 76));
            add(fillerPane);
        }

    }
}

Side by comparison of your output (left) and mine (right)

enter image description here

Beside also getting reusability for free, imagine your client comes back and says, "I want to change the font" or even worse, "I just want to change the font on these few elements".

Which approach do you think will cope better?

Or, you get some user like me, whose blind as a bat and has the font accessibility of the system ramped right up?