Tag: swt

SWT – OS获取等宽字体的不可知方式

SWT中是否有一种方法可以简单地获得等宽字体,适用于各种操作系统? 例如。 这适用于Linux,但不适用于Windows: Font mono = new Font(parent.getDisplay(), “Mono”, 10, SWT.NONE); 或者我需要一个方法尝试加载不同的字体(Consolas,终端,摩纳哥,单声道),直到一个不为空? 或者,我可以在启动时在属性文件中指定它。 我尝试从Display获取系统字体,但这不是等宽字体。

无法在32位JVM上加载64位SWT库(替换SWT文件)

我正在尝试调试此问题,但不确定我需要在哪里替换 Eclipse的SWT jar文件。 当前系统配置: Eclipse Helios 3.6 – 32 Bit JDK 1.6 JVM – 32 Bit Windows 7 – 64 Bit 错误信息: java.lang.UnsatisfiedLinkError: Cannot load 64-bit SWT libraries on 32-bit JVM at org.eclipse.swt.internal.Library.loadLibrary(Library.java:194) at org.eclipse.swt.internal.Library.loadLibrary(Library.java:174) at org.eclipse.swt.internal.C.(C.java:21) at org.eclipse.swt.widgets.Display.(Display.java:138) at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:687) at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:161) at de.vogella.rcp.intro.first.Application.start(Application.java:18) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) […]