我正在尝试了解 Java 布局。但我的框架没有显示。我做错了什么。能否请你帮忙?
public class NewClass {
NewClass(){
JFrame f=new JFrame();
JPanel jPanelcolor=new JPanel();
JPanel jPanelLayout=new JPanel( new GridLayout(3,3));
JTextField fieldred=new JTextField();
JSlider jsred=new JSlider();
JSlider jsgreen=new JSlider();
JSlider jsblue=new JSlider();
jPanelLayout.add(new JLabel("Red"));
jPanelLayout.add(jsred);
jPanelLayout.add(fieldred);
f.getContentPane().add(jPanelcolor, BorderLayout.CENTER);
f.getContentPane().add(jPanelcolor, BorderLayout.SOUTH);
f.setVisible(true);
}
public static void main(String[]args){
new NewClass();
}