Why don't drop??? [message #205966] |
Thu, 19 April 2007 06:05 |
wdaogang 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 |
Eclipse User |
|
|
|
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 #206704 is a reply to message #206236] |
Sun, 22 April 2007 21:04 |
Eclipse User |
|
|
|
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)
|
|
|
Powered by
FUDForum. Page generated in 0.09764 seconds