I use a custom class that extends JFrame, but sometimes it doesn't show anything. I never get any errors, so I'm curious if there is a java command that can help me print something. I was looking for other questions, but found nothing. This is actually not too crazy, but it is curious why this is happening. I would like to fix the problem in order to avoid future problems.
Blank
GUI
public MemberPanel(int i) throws IOException { Container contentPane = getContentPane(); GridLayout layout = new GridLayout(2, 1); contentPane.setLayout(layout); setVisible(true); setLocation(0, 0); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setSize(640, 170); setResizable(false); greenStatus = new JButton("Non-Critical"); yellowStatus = new JButton("Important"); redStatus = new JButton("Mission Critical"); greenStatus.setFont(fontTextOne); yellowStatus.setFont(fontTextOne); redStatus.setFont(fontTextOne); greenStatus.addActionListener(this); yellowStatus.addActionListener(this); redStatus.addActionListener(this); buttonPanel.add(greenStatus); buttonPanel.add(yellowStatus); buttonPanel.add(redStatus); statusLabel = new JLabel("In 75 letters or less... What are you working on?"); statusLabel.setVerticalAlignment(JLabel.CENTER); statusLabel.setHorizontalAlignment(JLabel.CENTER); statusLabel.setFont(fontTextTwo); textFieldPanel.add(statusLabel); textFieldPanel.add(statusMessage); contentPane.add(buttonPanel); contentPane.add(textFieldPanel); }
source share