Hey this is my second post so don't get mad at me but I'm having issues with the JPanel in java. I am trying to set the size and the location but it won't work, I have tried repaint(); but that does not work. Any help?
here's my code:
package test.test.test;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.TextField;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class Test extends JFrame {
JPanel colorPanel = new JPanel();
public Display(){
super("JPanel test");
setLayout(new FlowLayout());
add(colorPanel);
colorPanel.setBackground(Color.CYAN);
colorPanel.setSize(300, 300);
repaint();
}
}