java 如何解决“导入 org.eclipse.wb.swt.SWTResourceManager”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10474808/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to resolve "import org.eclipse.wb.swt.SWTResourceManager"
提问by moshfiqur
I have a SWT application and it was working fine. I was using Google WindowBuilder Pro to build the application windows. Today I was trying to do some update on my application. So when I open it I found an error saying "import org.eclipse.wb.swt.SWTResourceManager the import cannot be resolved
". But it was working previously. Can anyone tell me what could be the problem?
我有一个 SWT 应用程序,它运行良好。我正在使用 Google WindowBuilder Pro 来构建应用程序窗口。今天我试图对我的应用程序做一些更新。所以当我打开它时,我发现一个错误说“ import org.eclipse.wb.swt.SWTResourceManager the import cannot be resolved
”。但它以前是有效的。谁能告诉我可能是什么问题?
I am using Eclipse Helios for the development.
我正在使用 Eclipse Helios 进行开发。
回答by Chris
This helper class is generated inside your project by WindowBuilder as soon as you change for example the font of a label.
只要您更改例如标签的字体,WindowBuilder 就会在您的项目中生成此帮助程序类。
The code for the class can also be found by googling for the name, for example here: https://github.com/vogellacompany/codeexamples-java/blob/master/de.vogella.databinding.windowbuilder.example/src/com/swtdesigner/SWTResourceManager.java
类的代码也可以通过谷歌搜索名称找到,例如这里:https: //github.com/vogellacompany/codeexamples-java/blob/master/de.vogella.databinding.windowbuilder.example/src/com /swtdesigner/SWTResourceManager.java
回答by CosminO
I had the same problem. The workaround i used was to create a new class (of the same type, in my case SWT Application Window) and copy all the code from the faulty class to the new one.
我有同样的问题。我使用的解决方法是创建一个新类(相同类型,在我的例子中是 SWT 应用程序窗口)并将所有代码从有问题的类复制到新类。
回答by user3395004
download the window builder jar file and add it to your project. (right click the project, choose properties, and click add variable, then choose the jar file your downloaded)
下载窗口生成器 jar 文件并将其添加到您的项目中。(右键项目,选择属性,点击添加变量,然后选择你下载的jar文件)
回答by Laxman G
I had some problem. I tried to find the jar and fix the problem. But I was not able to locate the jar. Instead I found the source in this linkdownloaded and put in same package structure in my project.
我遇到了一些问题。我试图找到罐子并解决问题。但是我找不到罐子。相反,我在此链接中找到了下载的源代码,并在我的项目中放入了相同的包结构。
It work for me, Download the source from below link :
http://grepcode.com/file_/repo1.maven.org/maven2/org.beanfabrics/beanfabrics-swt/1.4.0/com/swtdesigner/SWTResourceManager.java/?v=source&disposition=attachment
它对我有用,从以下链接下载源:http:
//grepcode.com/file_/repo1.maven.org/maven2/org.beanfabrics/beanfabrics-swt/1.4.0/com/swtdesigner/SWTResourceManager.java/ ?v=来源&处置=附件
Hope it may be help full for other also.
希望它也可以对其他人有所帮助。
回答by Blasanka
There is jar files in internet. But I having problem with those. What I did to solve this,
互联网上有jar文件。但我对这些有问题。我做了什么来解决这个问题,
download the SWTResourceManager
java file from the github- click this. Then I edit some lines, those are:
SWTResourceManager
从github下载java 文件- 点击这里。然后我编辑了一些行,它们是:
- In SWTResourceManager.javafile, change
package org.eclipse.wb.swt;
to your package name. - And in whatever.javayour java file you are going to use that
library, remove
import org.eclipse.wb.swt.SWTResourceManager;
this line or change to your package.
- 在SWTResourceManager.java文件中,更改
package org.eclipse.wb.swt;
为您的包名称。 - 在whatever.java 中,您将要使用该库的java 文件,删除
import org.eclipse.wb.swt.SWTResourceManager;
此行或更改为您的包。
Now you good to go..
现在你可以走了..