Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » X Resource Class Names(Can I specify X resource class or instance names other than SWT?)
X Resource Class Names [message #734952] Mon, 10 October 2011 14:10 Go to next message
Mark Fenbers is currently offline Mark FenbersFriend
Messages: 48
Registered: July 2009
Location: Ohio, USA
Member
When I read the output from the xprop utility regarding my Java program, I see a WM_CLASS line giving "SWT" as the instance name as well as the class name. Can I specify other names for these so that end-users can configure specific X resources (such as font, or background color, etc.) in my program (like they can with X apps like xterm, etc.)???

Mark
Re: X Resource Class Names [message #735692 is a reply to message #734952] Wed, 12 October 2011 14:41 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2151
Registered: July 2009
Senior Member
I think Display.setAppName(String) is what you want (if not then please
follow up here).

Grant


On 10/10/2011 10:10 AM, Mark wrote:
> When I read the output from the xprop utility regarding my Java program,
> I see a WM_CLASS line giving "SWT" as the instance name as well as the
> class name. Can I specify other names for these so that end-users can
> configure specific X resources (such as font, or background color, etc.)
> in my program (like they can with X apps like xterm, etc.)???
>
> Mark
Re: X Resource Class Names [message #736206 is a reply to message #735692] Thu, 13 October 2011 19:56 Go to previous messageGo to next message
Mark Fenbers is currently offline Mark FenbersFriend
Messages: 48
Registered: July 2009
Location: Ohio, USA
Member
Great idea, but after adding this and relaunching, xprop utility still showed "SWT" and "SWT" as the instance and class names...

Other ideas?
Mark
Re: X Resource Class Names [message #763657 is a reply to message #734952] Sat, 10 December 2011 08:10 Go to previous message
MadMaverick9 I is currently offline MadMaverick9 IFriend
Messages: 1
Registered: December 2011
Junior Member
import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
 
public class SWTHelloWorld 
{
   public static void main (String[] args) 
  {
      Display.setAppName("SWTHelloWorld");
      Display display = new Display();
      Shell shell = new Shell(display);
      shell.setText("SWT Hello World");
      Label label = new Label(shell, SWT.NONE);
      label.setText("Hello World");
      label.pack();
      shell.pack();
      shell.open();
      while (!shell.isDisposed()) 
      {
         if (!display.readAndDispatch()) display.sleep();
      }
      display.dispose();
   }
}

Now I can develop java applications that work properly with the FVWM Window Manager. Thanks for SWT!

java/swing applications do not work well with the FVWM Window Manager.
Previous Topic:Composite is slow to draw
Next Topic:MessageDialog default button
Goto Forum:
  


Current Time: Mon Nov 24 14:22:24 GMT 2014

Powered by FUDForum. Page generated in 0.02372 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software