0

ボタンを RCP クライアントに追加したいと考えています。ウィンドウには、barChart と 3 つのボタンを表示する必要があります。

次の行を追加すると: panel.add(button); エラーを返します: タイプ Container のメソッド add(Component) は、引数 (Button) には適用できません。

助けてください :)

@Override
    protected void createWindows(final Shell shell) throws Exception {
        shell.setLayout(new FillLayout());
        final Composite composite = new Composite(shell, SWT.EMBEDDED);

        final Frame frame = SWT_AWT.new_Frame(composite); 
        final StaticBarSketch barGraph = new StaticBarSketch();
        final Button button = new Button(composite, SWT.PUSH);
        button.setText("Press");

        Panel panel = new Panel();
        panel.add(barGraph);
        frame.add(panel);
        barGraph.init();

        composite.addListener(SWT.Resize, new Listener() {
            @Override
            public void handleEvent(Event event) {
                barGraph.resized(composite.getSize().x, composite.getSize().y);
            }
        });
4

1 に答える 1