WinXP look and Feel

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

WinXP look and Feel

Postby Kelly » Sun Dec 25, 2005 7:58 am

More than likely people already know this but it took me awhile to get WinXP look and feel working on my standalone SWT program and thought I would share.

The reason I wanted the WinXp LAF was that I wanted icons and text in my buttons and they added that to SWT 3.2M3 which is also in the Eclipse 3.2M4 release.

You do not see both icon and text in the designer but thats not a big deal to me. Unless someone knows of a way to get this, let me know.

The LAF depends on a file called ???.manifest, the (???) should be the name of the executable, Eclipse uses the executable called javaw.exe, so the filename would be javaw.exe.manifest.

javaw.exe.manifest file:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="SWT.javaw" type="win32"/>
<description>Standard Widget Toolkit</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*"/>
</dependentAssembly>
</dependency>
</assembly>

The text within the file stays the same only the file name changes.
(Text may get newlines inserted so make sure all <.../> are one line.)

If you want Eclipse to have a WinXP LAF then place the manifest file in the same directory as the javaw.exe but be careful cause Sun places a copy in your /windows/system32 directory as well as in the installed_dir/bin when you run the Java install.

I only wanted my application to have WinXP LAF not Eclipse so I had to do the following.

Copy javaw.exe to your application's install directory and rename it so that it matches your application name like myapp.exe.
Next create a bat file with the following.
myapp.exe -Djava.library.path=. -jar myapp.jar

(I had posted here awhile back on how to get a standalone executable, so you need all jars and dll you use here and the manifest.mf file in your application jar file.)

It is much better to use a desktop shortcut than a bat file, that way you do not get the cmd shell window.

Name your manifest file myapp.exe.manifest

Now execute the bat file or shortcut and you should have WinXP LAF.

I have tried to get UIManager.setLookAndFeel() method to work but do not know the class name to past to the method and if it would work at all because UIManager is Swing. I know nothing about Swing and only a little bit about SWT/Java.

I have only done this on a WinXP operating system.

Hope this helps someone out.
Kelly
 
Posts: 38
Joined: Wed Feb 02, 2005 8:22 am

Postby Kelly » Sat Apr 15, 2006 6:29 am

This fix is no longer needed when I use the following release versions.

Eclipse 3.2.RC1
Java 6 beta
WindowBuilder Pro, Version: 4.3.1, Build id: 2006.04.14

:D
Kelly
 
Posts: 38
Joined: Wed Feb 02, 2005 8:22 am

Postby Eric Clayberg » Sat Apr 15, 2006 3:21 pm

Kelly wrote:This fix is no longer needed when I use the following release versions.
Eclipse 3.2.RC1
Java 6 beta
WindowBuilder Pro, Version: 4.3.1, Build id: 2006.04.14

This is due to a fix in Eclipse 3.2 RC1. See...

https://bugs.eclipse.org/bugs/show_bug.cgi?id=45918

http://www.eclipsezone.com/eclipse/forums/t69466.html
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to SWT Designer

Who is online

Users browsing this forum: No registered users and 1 guest