问题描述
//为内部窗体添加Action的方法privateJButtoncreateFrameButton(StringfName,Stringcname){StringimgUrl="res/ActionIcon/"+fName+".png";StringimgUrl_roll="res/ActionIcon/"+fName+"_roll.png";StringimgUrl_down="res/ActionIcon/"+fName+"_down.png";Iconicon=newImageIcon(imgUrl);Iconicon_roll=null;if(imgUrl_roll!=null)icon_roll=newImageIcon(imgUrl_roll);Iconicon_down=null;if(imgUrl_down!=null)icon_down=newImageIcon(imgUrl_down);Actionaction=newopenFrameAction(fName,cname,icon);JButtonbutton=newJButton(action);button.setMargin(newInsets(0,0,0,0));button.setHideActionText(true);//出现这样的错误:ThemethodsetHideActionText(boolean)isundefinedforthetypeJButtonbutton.setFocusPainted(false);button.setBorderPainted(false);//button.setContentAreaFilled(false);if(icon_roll!=null)button.setRolloverIcon(icon_roll);if(icon_down!=null)button.setPressedIcon(icon_down);returnbutton;}
解决方案
解决方案二:
jdk1.6才能使用的方法是不是你的jdk版本不对
解决方案三:
LZ从来都不结贴看这个类的API:从以下版本开始:1.6所以是你的编译器使用的JDK版本太低,估计是1.5
解决方案四:
估计是JDK版本太低的问题,LZ用1.6试试吧
解决方案五:
同解
解决方案六:
谢谢大家了!确是如此