Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » No labels
No labels [message #466296] Fri, 06 January 2006 01:13 Go to next message
Geoffrey Ritchey is currently offline Geoffrey RitcheyFriend
Messages: 42
Registered: July 2009
Member
There is no text on Labels and Buttons using swt-win32-3139.dll in the
directory C:\x86 when I run in stand-alone mode as in the ant script
below. This runs Snippet108 to display a very simple form. That code is
below as well. An interesting note is that if I leave the application
running, something triggers a re-draw and the text gets displayed.


<path id="my.class.path">
<pathelement path="build"/>
<pathelement
location="C:/x86/org.eclipse.swt.win32.win32.x86_3.1.1.jar"/ >
</path>

<target name="x" depends="compile"
description="run the application" >
<java dir="build"
fork="true"
classname="org.eclipse.swt.snippets.Snippet108" >
<jvmarg value="-Djava.library.path=C:\x86"/>
<classpath refid="my.class.path">
</classpath>
</java>
</target>


SNIPPET..............

/*********************************************************** ********************
* Copyright (c) 2000, 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
************************************************************ *******************/
package org.eclipse.swt.snippets;

/*
* Label example snippet: create a label (a separator)
*
* For a list of all SWT example snippets see
* http://www.eclipse.org/swt/snippets/
*/
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.RowData;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;

public class Snippet108 {

public static void main (String [] args) {
Display display = new Display ();
Shell shell = new Shell (display);
Label label = new Label (shell, SWT.NONE);
label.setText ("Enter your name:");
Text text = new Text (shell, SWT.BORDER);
text.setLayoutData (new RowData (100, SWT.DEFAULT));
Button ok = new Button (shell, SWT.PUSH);
ok.setText ("OK");
ok.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
System.out.println("OK");
}
});
Button cancel = new Button (shell, SWT.PUSH);
cancel.setText ("Cancel");
cancel.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
System.out.println("Cancel");
}
});
shell.setDefaultButton (cancel);
shell.setLayout (new RowLayout ());
shell.pack ();
shell.open ();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}
}
Re: No labels [message #466345 is a reply to message #466296] Fri, 06 January 2006 20:29 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
People have reported an issue like this when running with java.exe which
gets fixed by running with javaw.exe. I have never seen this problem myself
and I run with both regularly.

What VM are you using? Can you try a different one?

"Geoffrey Ritchey" <geoffritchey@hotmail.com> wrote in message
news:4b03be892b5c2279a8c742af972d247b$1@www.eclipse.org...
>
> There is no text on Labels and Buttons using swt-win32-3139.dll in the
> directory C:\x86 when I run in stand-alone mode as in the ant script
> below. This runs Snippet108 to display a very simple form. That code is
> below as well. An interesting note is that if I leave the application
> running, something triggers a re-draw and the text gets displayed.
>
>
> <path id="my.class.path">
> <pathelement path="build"/>
> <pathelement location="C:/x86/org.eclipse.swt.win32.win32.x86_3.1.1.jar"/ >
> </path>
>
> <target name="x" depends="compile"
> description="run the application" >
> <java dir="build"
> fork="true"
> classname="org.eclipse.swt.snippets.Snippet108" >
> <jvmarg value="-Djava.library.path=C:\x86"/> <classpath
> refid="my.class.path">
> </classpath>
> </java> </target>
>
>
> SNIPPET..............
>
> /*********************************************************** ********************
> * Copyright (c) 2000, 2004 IBM Corporation and others.
> * All rights reserved. This program and the accompanying materials
> * are made available under the terms of the Eclipse Public License v1.0
> * which accompanies this distribution, and is available at
> * http://www.eclipse.org/legal/epl-v10.html
> *
> * Contributors:
> * IBM Corporation - initial API and implementation
> ************************************************************ *******************/
> package org.eclipse.swt.snippets;
>
> /*
> * Label example snippet: create a label (a separator)
> *
> * For a list of all SWT example snippets see
> * http://www.eclipse.org/swt/snippets/
> */
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.events.SelectionAdapter;
> import org.eclipse.swt.events.SelectionEvent;
> import org.eclipse.swt.layout.RowData;
> import org.eclipse.swt.layout.RowLayout;
> import org.eclipse.swt.widgets.Button;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Label;
> import org.eclipse.swt.widgets.Shell;
> import org.eclipse.swt.widgets.Text;
>
> public class Snippet108 {
>
> public static void main (String [] args) {
> Display display = new Display ();
> Shell shell = new Shell (display);
> Label label = new Label (shell, SWT.NONE);
> label.setText ("Enter your name:");
> Text text = new Text (shell, SWT.BORDER);
> text.setLayoutData (new RowData (100, SWT.DEFAULT));
> Button ok = new Button (shell, SWT.PUSH);
> ok.setText ("OK");
> ok.addSelectionListener(new SelectionAdapter() {
> public void widgetSelected(SelectionEvent e) {
> System.out.println("OK");
> }
> });
> Button cancel = new Button (shell, SWT.PUSH);
> cancel.setText ("Cancel");
> cancel.addSelectionListener(new SelectionAdapter() {
> public void widgetSelected(SelectionEvent e) {
> System.out.println("Cancel");
> }
> });
> shell.setDefaultButton (cancel);
> shell.setLayout (new RowLayout ());
> shell.pack ();
> shell.open ();
> while (!shell.isDisposed ()) {
> if (!display.readAndDispatch ()) display.sleep ();
> }
> display.dispose ();
> }
> }
>
Re: No labels [message #466369 is a reply to message #466345] Mon, 09 January 2006 17:25 Go to previous messageGo to next message
Geoffrey Ritchey is currently offline Geoffrey RitcheyFriend
Messages: 42
Registered: July 2009
Member
Here is the command I run and get no Text on labels and buttons:

"C:\Program Files\Java\jre1.5.0_06\bin\javaw.exe"
-Djava.library.path=C:\x86


If I change javaw to java I get the text again.

Here is the version information:

java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
Re: No labels [message #466446 is a reply to message #466369] Tue, 10 January 2006 15:47 Go to previous messageGo to next message
Geoffrey Ritchey is currently offline Geoffrey RitcheyFriend
Messages: 42
Registered: July 2009
Member
In my previous post I said I changed javaw to java and it worked, but
actually it was the reverse. I changed java to javaw. One thing that
this implies is that I can't use the java 'ant task' to test. I probably
have to set up and ant task to spawn javaw instead.

This seems like a serious problem to me even if there is an easy fix. Is
there any work being done to find out what's happening here? Is there an
open bug report?
Re: No labels [message #466494 is a reply to message #466446] Tue, 10 January 2006 18:32 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
See:

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

"Geoffrey Ritchey" <geoffritchey@hotmail.com> wrote in message
news:95e67562bd4064239a49b38ff0febc84$1@www.eclipse.org...
> In my previous post I said I changed javaw to java and it worked, but
> actually it was the reverse. I changed java to javaw. One thing that
> this implies is that I can't use the java 'ant task' to test. I probably
> have to set up and ant task to spawn javaw instead.
>
> This seems like a serious problem to me even if there is an easy fix. Is
> there any work being done to find out what's happening here? Is there an
> open bug report?
>
Previous Topic:PDF Problem with SWT Browser on Linux/GTK SWT 3.1.1 w/ Mozilla
Next Topic:Table Cell Colors
Goto Forum:
  


Current Time: Sat Apr 20 04:19:02 GMT 2024

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

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

Back to the top