如何在JPanel上放一个扩展栏? [英] How to put an expandbar on a JPanel?
问题描述
这是代码我使用了:( http://www.eclipse.org/swt/snippets/#expandbar)
显示display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
shell.setText(ExpandBar Example);
ExpandBar bar = new ExpandBar(shell,SWT.V_SCROLL);
我已经尝试添加扩展栏到面板,以及尝试添加显示和shell到面板,但不起作用。
请帮忙。
谢谢
您的代码相当不完整,基于我在线看到的示例。我不太了解 我测试了它,它的工作原理。 Is there a way to add a expandbar onto a jframe or jpanel without creating each component with code (using components that is already created). Here is the code I used: ( http://www.eclipse.org/swt/snippets/#expandbar ) I have tried to add the expandbar to the panel, as well as trying to add the display and the shell to the panel, but does not work. Please help.
Thanks Your code is rather incomplete, basing on the example I saw online. I don't know much about I tested it and it works. The 这篇关于如何在JPanel上放一个扩展栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! SWT
但 ExpandBar
它不是子组件 code>或
Container
,因此无法将其添加到面板
或帧
。
发现一个很好的例子这里
ExpandBar
文档被找到这里 Display display = new Display ();
Shell shell = new Shell (display);
shell.setLayout(new FillLayout());
shell.setText("ExpandBar Example");
ExpandBar bar = new ExpandBar (shell, SWT.V_SCROLL);
SWT
but ExpandBar
its not a subclass of Component
nor Container
so they can't be added to a Panel
or Frame
.
Found a good example here.ExpandBar
documentation is found here