Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Please help on the AWT_SWT ....
Please help on the AWT_SWT .... [message #438644] Tue, 29 June 2004 04:23 Go to next message
Richard is currently offline RichardFriend
Messages: 49
Registered: July 2009
Member
Hi:

I am a new comer using eclipse, recently I found the solution to embed
swing Jtree in the GUI developed with eclipse. But when I tried, the
compiler can not locate

"package org.eclipse.swt.examples.awt.win32;"

"import org.eclipse.swt.internal.awt.win32.*;"

And this result in AWT_SWT can not be recognised.

So please tell me how to correctly configure the platform (e.g.: where to
dowload them, and what files need to be loades using "import")so that I
can use the AWT_SWT class to make swing Jtree valid.

Many thanks in advance

Richard
Re: Please help on the AWT_SWT .... [message #438659 is a reply to message #438644] Tue, 29 June 2004 12:25 Go to previous message
Eclipse UserFriend
Originally posted by: elvis.graceland.com

The class name is SWT_AWT not AWT_SWT.

Here's code I used to test it out with a simple workbench view:

------------------------------------------------------------ ------
package test;

import java.awt.*;
import javax.swing.*;
import org.eclipse.swt.SWT;
import org.eclipse.swt.awt.SWT_AWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;

public class MyView extends ViewPart {
public static final String ID_VIEW = "test.MyView";

private Composite _ui;

public void createPartControl(Composite parent) {
setPartName("My Test View");

_ui = new Composite(parent, SWT.EMBEDDED);
Frame f = SWT_AWT.new_Frame(_ui);
f.add(createContent());
}

public void setFocus() {
_ui.setFocus();
}

private Component createContent() {
JPanel p = new JPanel(new BorderLayout());
p.add(new JLabel("Swing JLabel", JLabel.CENTER),
BorderLayout.NORTH);
p.add(new JTextArea(), BorderLayout.CENTER);
p.add(new JCheckBox("Swing JCheckBox"), BorderLayout.SOUTH);
return p;
}
}
Previous Topic:How to set a button to be defualt selected
Next Topic:How to add a combobox on the toolbar
Goto Forum:
  


Current Time: Fri Apr 26 07:20:47 GMT 2024

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

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

Back to the top