有没有eclipse插件开发的高手啊,偶刚开始学插件开发,碰到以下问题阻塞,请高手解答!
以下代码运行后,图像框出不来!
private static void testImage()
{
Shell shell = new Shell();
LightweightSystem lws = new LightweightSystem(shell);
Figure parent = new Figure();
parent.setLayoutManager(new XYLayout());
lws.setContents(parent);
ImageFigure image = new ImageFigure(null);
image.setBackgroundColor(ColorConstants.orange);
image.setBounds(new Rectangle(10,70,80,20));
parent.add(image, new Rectangle(20,90,100,40));
shell.setSize(400,300);
shell.open();
shell.setText("Example");
Display display = Display.getDefault();
while (!shell.isDisposed())
{
if (!display.readAndDispatch())
display.sleep ();
}
}
以下代码运行后,图像框出不来!
private static void testImage()
{
Shell shell = new Shell();
LightweightSystem lws = new LightweightSystem(shell);
Figure parent = new Figure();
parent.setLayoutManager(new XYLayout());
lws.setContents(parent);
ImageFigure image = new ImageFigure(null);
image.setBackgroundColor(ColorConstants.orange);
image.setBounds(new Rectangle(10,70,80,20));
parent.add(image, new Rectangle(20,90,100,40));
shell.setSize(400,300);
shell.open();
shell.setText("Example");
Display display = Display.getDefault();
while (!shell.isDisposed())
{
if (!display.readAndDispatch())
display.sleep ();
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货