No labels [message #466296] |
Thu, 05 January 2006 20:13  |
Eclipse User |
|
|
|
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 #466494 is a reply to message #466446] |
Tue, 10 January 2006 13:32  |
Eclipse User |
|
|
|
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?
>
|
|
|
Powered by
FUDForum. Page generated in 0.04526 seconds