Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Why don't drop???
Why don't drop??? [message #205966] Thu, 19 April 2007 06:05 Go to next message
wdaogang is currently offline wdaogangFriend
Messages: 11
Registered: July 2009
Junior Member
Thank you ,weidaogang

import org.eclipse.swt.dnd.DropTargetEvent;
import org.eclipse.swt.dnd.DropTargetListener;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import com.swtdesigner.SWTResourceManager;


public class Dsa extends Shell {

private Text ghText;
/**
* Launch the application
* @param args
*/
public static void main(String args[]) {
try {
Display display = Display.getDefault();
Dsa shell = new Dsa(display, SWT.SHELL_TRIM);
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
} catch (Exception e) {
e.printStackTrace();
}
}

/**
* Create the shell
* @param display
* @param style
*/
public Dsa(Display display, int style) {
super(display, style);
createContents();
}

/**
* Create contents of the window
*/
protected void createContents() {
setText("SWT Application");
setSize(500, 375);

final Label label = new Label(this, SWT.NONE);
label.setForeground(SWTResourceManager.getColor(0, 0, 128));
label.setFont(SWTResourceManager.getFont("", 36, SWT.BOLD));
label.setText("
Re: Why don't drop??? [message #206236 is a reply to message #205966] Thu, 19 April 2007 20:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wharley.bea.com

"w" <wdaogang@163.com> wrote in message
news:f070pv$1oc$1@build.eclipse.org...
> Thank you ,weidaogang
>
> [code snipped]


You may notice that very few questions like yours get answered on this
newsgroup. People here want to help, but our time is limited. We mostly
don't have time to try to read your code, understand what you are expecting
it to do, set up a test case for it, step through it in the debugger, try to
figure out where it is behaving differently than expected, and if it behaves
as expected for us, try to figure out what we might be doing differently
than you.

You need to do those things for yourself. Then, when you run into a
specific question like "why does method getXXX() on line YYY return null,
when I would expect it to return a ZZZ?", you will be more likely to get an
answer to that question. Especially if you explain what else you have
tried, whether the code worked in another context, and so forth.
Re: Why don't drop??? [message #206260 is a reply to message #206236] Fri, 20 April 2007 02:20 Go to previous messageGo to next message
wdaogang is currently offline wdaogangFriend
Messages: 11
Registered: July 2009
Junior Member
Thank you! лл
Re: Why don't drop??? [message #206704 is a reply to message #206236] Sun, 22 April 2007 21:04 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse5.rizzoweb.com

Walter Harley wrote:
> You may notice that very few questions like yours get answered on this
> newsgroup. People here want to help, but our time is limited. We mostly
> don't have time to try to read your code, understand what you are expecting
> it to do, set up a test case for it, step through it in the debugger, try to
> figure out where it is behaving differently than expected, and if it behaves
> as expected for us, try to figure out what we might be doing differently
> than you.
>
> You need to do those things for yourself. Then, when you run into a
> specific question like "why does method getXXX() on line YYY return null,
> when I would expect it to return a ZZZ?", you will be more likely to get an
> answer to that question. Especially if you explain what else you have
> tried, whether the code worked in another context, and so forth.

Excellent advice. See also:
http://www.catb.org/~esr/faqs/smart-questions.html

Eric (not the author of the above)
Previous Topic:Different default directory for different languages
Next Topic:bootclasspath
Goto Forum:
  


Current Time: Fri Apr 19 22:06:02 GMT 2024

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

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

Back to the top