java中JLabel怎么显示不了图片???
publicclasspictureextendsJFrame{JLabellabel;publicpicture(){super("picture");ImageIco...
public class picture extends JFrame { JLabel label; public picture() { super("picture"); ImageIcon p=new ImageIcon("E:\\picture\\lc.pjg"); label=new JLabel("图片",p,SwingConstants.CENTER); label.setToolTipText("this is picture"); add(label); setVisible(true); label.setHorizontalAlignment(SwingConstants.LEFT); } }import javax.swing.*;
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询