ava.Swing.GroupLayout cannot be resolved.解决办法

这个错误提示是因为Myeclipse版本较低,而且Myeclipse默认使用的是自身带的jre版本;
低版本中不支持类Java.Swing.GroupLayout,需要安装较高版本的jdk(带jre)的版本,如果用户已经装了就可以直接对Myeclipse进行设置了!
在Myeclipse的菜单栏找到windows选项,选中其下拉菜单下的preferences;
Java.Swing.GroupLayout <wbr>cannot <wbr>be <wbr>resolved.解决办法
Java.Swing.GroupLayout <wbr>cannot <wbr>be <wbr>resolved.解决办法
按上图红笔标识部分操作,看到上图右半边的界面,但是你的应该只有下面“MyEclipse 6.0”的选项,没有上面jre1.6.0_12的选项,需要按最左边栏的“Add“按钮添加:
Java.Swing.GroupLayout <wbr>cannot <wbr>be <wbr>resolved.解决办法
注意:通过Browse选择你jre安装的文件夹,另外如果你像我一样文件名不是jre版本,要把”JRE NAME“默认给你添加上的文件名改成你jre的版本号名,这个可以通过:
运行-->cmd-->java -version
Java.Swing.GroupLayout <wbr>cannot <wbr>be <wbr>resolved.解决办法
期中:<build 1.6.0_12-b04>中1.6.0_12就是你jre的版本号;
填好这些后直接ok就行了,上面由于我添加过这个jre了,所以下面有”The name is already used"错误提示,而且“ok“按钮处于不能用状态,你的没有添加不会有这个提示,直接按”ok“按钮就回到上个界面,将“对勾”打到你添加的jre版本前面,确定退出就可以了!
现在就可以运行上篇那个透明面板代码了!
写的很罗嗦啊!嘿嘿Java.Swing.GroupLayout <wbr>cannot <wbr>be <wbr>resolved.解决办法Java.Swing.GroupLayout <wbr>cannot <wbr>be <wbr>resolved.解决办法
加油!Java.Swing.GroupLayout <wbr>cannot <wbr>be <wbr>resolved.解决办法

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
resetButton.setIcon(new ImageIcon(AddCourseFrm.class.getResource("/images/\u91CD\u7F6E.png"))); resetButton.setFont(new Font("微软雅黑", Font.PLAIN, 14)); GroupLayout groupLayout = new GroupLayout(getContentPane()); groupLayout.setHorizontalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup() .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addGap(88) .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addComponent(label_2) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(studentNumTextField, GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE)) .addGroup(groupLayout.createSequentialGroup() .addComponent(label_1) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(teacherListComboBox, 0, 149, Short.MAX_VALUE)) .addGroup(groupLayout.createSequentialGroup() .addComponent(label) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(courseNameTextField, GroupLayout.DEFAULT_SIZE, 155, Short.MAX_VALUE)) .addGroup(groupLayout.createSequentialGroup() .addComponent(label_3) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(courseInfoTextArea, GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE)))) .addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup() .addGap(103) .addComponent(addCourseButton) .addGap(18) .addComponent(resetButton))) .addGap(117)) ); groupLayout.setVerticalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addGap(19) .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) .addComponent(label) .addComponent(courseNameTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGap(35) .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) .addComponent(label_1) .addComponent(teacherListComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGap(37) .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) .addComponent(label_2) .addComponent(studentNumTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGap(38) .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) .addComponent(label_3) .addComponent(courseInfoTextArea, GroupLayout.PREFERRED_SIZE, 120, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED, 46, Short.MAX_VALUE) .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) .addComponent(addCourseButton) .addComponent(resetButton)) .addGap(57)) ); getContentPane().setLayout(groupLayout); setTeacherCombox(); }分析每一句作用
最新发布
06-03
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值