javax.swing.grouplayout 在 jdk 1.5 中不存在

发布于 2024-08-14 00:41:11 字数 269 浏览 3 评论 0原文

我用netbeans开发了一个java应用程序。它使用jdk 1.6。

效果很好。

但现在的要求是我需要从另一台没有 netbeans 且使用 jdk 1.5 的计算机中的 .java 文件构建应用程序的 jar。我无法将该机器升级到jdk 1.6。

有什么办法可以让我的java文件在jdk 1.5机器上编译和工作,并对我的源代码进行尽可能小的更改。

错误是javax.swing.grouplayout在jdk 1.5中不可

用请帮忙...

I developed a java application with netbeans. It used jdk 1.6.

It works fine.

But now the requirement is I need to build the jar for the application from the .java files in another machine without netbeans and where jdk 1.5 is used. I cannot upgrade that machine to jdk 1.6.

Is there any way I could make my java files compile and work in jdk 1.5 machine with a possible minimal change to my source code..

The error is javax.swing.grouplayout not available in jdk 1.5

Please help...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

策马西风 2024-08-21 00:41:11

使用 netbeans 首选项并选择 org.jdesktop...,通过在表单中​​右键单击手动更新生成的代码(检查器窗口 -> 选择 swing 布局扩展而不是标准 java6 代码)。

Use the netbeans preferences and select org.jdesktop...., update manually the generated code by right-click in the form (Inspector Window -> select swing layout extensions instead of standard java6 code).

千纸鹤 2024-08-21 00:41:11

对于 NetBeans,请参阅 John Doe 的回答。对于带有 MyEclipse 的 Eclipse,您可以使用 Matisse,在 Outline View 中选择 Form。现在,在“属性”视图中查看“布局生成样式”并选择“Swing 布局扩展库”而不是“标准 Java 6 代码”。

For NetBeans, see the answer by John Doe. For Eclipse with MyEclipse so you can use Matisse, in the Outline View, select the Form. Now in the Properties View look at "Layout Generation Style" and select "Swing Layout Extensions Library" rather than "Standard Java 6 Code."

゛清羽墨安 2024-08-21 00:41:11

同时,“Matisse”库不再可用,但 JDK 1.6 源代码,例如 code.yawk.at。存在类javax.swing.Grouplayout,它依赖于java.awt.Component,它在JDK 1.6中由java.awt.Component.BaselineResizeBehavior扩展和一些方法。

解决方案是从这些类构建一个带有嵌套 BaselineResizeBehaviorjavax5.swing.Grouplayout 类。选择该包不会干扰保留的包javax.swing。来自 Component 的其他依赖项具有简单的实现,并且可以在 javax5.swing.Grouplayout 中替换。

Meanwhile the "Matisse" library is no more available, but JDK 1.6 sources, e.g. code.yawk.at. There exists class javax.swing.Grouplayout, it has dependencies from java.awt.Component, which was extended in JDK 1.6 by java.awt.Component.BaselineResizeBehavior and some methods.

Solution is to build from these a class javax5.swing.Grouplayout with nested BaselineResizeBehavior. The package is chosen to not interfere with reserved package javax.swing. Other dependencies from Component have trivial implementation, there and can be substituted in javax5.swing.Grouplayout.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文