如何向窗口添加图片?
publicclassregardextendsJFrameimplementsWindowListener{JPanelp3=newJPanel(),p4=newJPa...
public class regard extends JFrame implements WindowListener{
JPanel p3 = new JPanel(),p4 = new JPanel();
JLabel lb9 = new JLabel("@by 11061061 aokoqingzi");
JLabel tu = new JLabel(new ImageIcon("d:\\java\\workspace\\feng.jpeg"));
JButton b3 = new JButton("确定");
Container contentpane2 = this.getContentPane();
mypanel2 wen = new mypanel2();
regard(){
this.setTitle("关于");
setSize(300,360);
setVisible(true);
contentpane2.setVisible(true);
contentpane2.add("Center",tu);
这个图片标签无论如何不显示啊~~~~ 展开
JPanel p3 = new JPanel(),p4 = new JPanel();
JLabel lb9 = new JLabel("@by 11061061 aokoqingzi");
JLabel tu = new JLabel(new ImageIcon("d:\\java\\workspace\\feng.jpeg"));
JButton b3 = new JButton("确定");
Container contentpane2 = this.getContentPane();
mypanel2 wen = new mypanel2();
regard(){
this.setTitle("关于");
setSize(300,360);
setVisible(true);
contentpane2.setVisible(true);
contentpane2.add("Center",tu);
这个图片标签无论如何不显示啊~~~~ 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询