Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » Eclipse view plugin: swing problem
Eclipse view plugin: swing problem [message #617296] Mon, 17 November 2008 04:33
Ben is currently offline BenFriend
Messages: 3
Registered: July 2009
Junior Member

Thanks in advance for any help that could be provided.

First of all, I am unaware if this mailgroup is even the good place to
post this, if not, could someone please recomment me to a good site/forum
where i could get help.

I am new to the Eclipse plugin world. I have a very short amount of time
to complete my project and do not have time to learn the SWT library. I am
very familiar with the Swing library and i have found a way to wrap Swing
into the view by doing the following.

public void createPartControl(Composite parent) {
UIManager.setLookAndFeel(" ");
}catch (Exception e){
//TODO: manage exception

Composite swtAwtComponent = new Composite(parent, SWT.EMBEDDED);
java.awt.Frame frame = SWT_AWT.new_Frame( swtAwtComponent );
Ftie_ui ui = new Ftie_ui();

The Ftie_ui class extends JPanel. Normally, with access to a JPanel, I
figured it would be easy to develop my project with Swing. I added 2
JLabels, 1 JTextField, 1 JPasswordField and 1 JButton. When i ran Eclipse
with my plugin, Everything got loaded in my JPanel, but i could not access
the JTextField and the JPasswordField. I have tryed setEnabled(true) and
setEditable(true) on the fields, but with no success, I could not manage
to put a cursor is the fields. The Ftie_ui class looks like the following
(I know, theres no layout yet).

For any help someone could bring, I would greatly appreciate it.
Thank you

package ftie.views;

import javax.swing.*;

public class Ftie_ui extends JPanel{
Authentification auth;

JLabel labelUser;
JLabel labelPass;
JTextField txtUser;
JPasswordField txtPass;
JButton btnLogin;

public Ftie_ui()
labelUser = new JLabel();

labelPass = new JLabel();

txtUser = new JTextField(20);

txtPass = new JPasswordField(20);

btnLogin = new JButton("Login");

Previous Topic:Eclipse view plugin: swing problem
Next Topic:How to get all java file from an JavaProject
Goto Forum:

Current Time: Fri May 20 07:16:08 GMT 2022

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

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

Back to the top