大神看一下我这个框架怎么错了

import java.awt.BorderLayout;

import java.awt.FlowLayout;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;


import javax.swing.JButton;

import javax.swing.JCheckBox;

import javax.swing.JFileChooser;

import javax.swing.JFrame;

import javax.swing.JLabel;

import javax.swing.JPanel;

import javax.swing.JTextField;



public class where extends JFrame implements ActionListener {

JLabel l1,l2;

JFileChooser f;

JTextField t;

JButton b1,b2;

JCheckBox c;

JPanel p1,p2;

where(){

l1=new JLabel("选择加密文件");

l2=new JLabel("选择加密/解密算子");

t=new JTextField(10);

b1=new JButton("确定");

b1=new JButton("取消");

c=new JCheckBox("覆盖文件");

f=new JFileChooser();

p1=new JPanel();

p2=new JPanel();

setLayout(new BorderLayout());

add(p1,BorderLayout.CENTER);

add(p2,BorderLayout.SOUTH);

f.setControlButtonsAreShown(false);

p1.add(p1);

p1.add(p2);

p2.setLayout(new FlowLayout(FlowLayout.LEFT));

p2.add(l1);

p2.add(l2);

p2.add(f);

p2.add(t);

p2.add(c);

this.setSize(300,400);

this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

this.setResizable(false);

this.setVisible(true);

setEvent();

}

private void setEvent() {

// TODO Auto-generated method stub

}


public static void main(String[] args) {

new where();

}

@Override

public void actionPerformed(ActionEvent arg0) {

// TODO Auto-generated method stub

}

}


慕粉1312236355
浏览 1202回答 1
1回答

噼喱啪啦

p1.add(p1); //这句可能是写错了. 你自己看看p1.add(p2);
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java