Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » Run Java Bean using main method
Run Java Bean using main method [message #120778] Tue, 21 March 2006 00:50 Go to next message
Eclipse UserFriend
Originally posted by: stepehn.gmail.com

I have use VE to generate an SWT Shell application and I've been running it
as a Java Bean. I want to modify this application so that it will:

- Run from a main method
- Rus as a Java Bean
- Still be editable using Visual Editor

Here is a sample empty SWT Shell application below, how do I modify this to
achieve my goals?

public class TestShell {
private static Shell sShell = null;
/**
* This method initializes sShell
*/
private void createSShell() {
sShell = new Shell();
sShell.setText("Shell");
sShell.setSize(new Point(300, 200));
sShell.setLayout(new GridLayout());
}
}
Re: Run Java Bean using main method [message #120782 is a reply to message #120778] Tue, 21 March 2006 02:21 Go to previous message
Jeff Myers is currently offline Jeff MyersFriend
Messages: 489
Registered: July 2009
Senior Member
Create another new Visual Class using the SWT Shell as the class type.
Choose the option to generate the main method in the New Wizard. The
code that's generated will have a main method capable of displaying the
shell when executed. You can then copy that main method into your
existing class and modify it to run that shell.

Hope this helps,
- Jeff
Re: Run Java Bean using main method [message #612333 is a reply to message #120778] Tue, 21 March 2006 02:21 Go to previous message
Jeff Myers is currently offline Jeff MyersFriend
Messages: 489
Registered: July 2009
Senior Member
Create another new Visual Class using the SWT Shell as the class type.
Choose the option to generate the main method in the New Wizard. The
code that's generated will have a main method capable of displaying the
shell when executed. You can then copy that main method into your
existing class and modify it to run that shell.

Hope this helps,
- Jeff
Previous Topic:default widget color
Next Topic:default widget color
Goto Forum:
  


Current Time: Wed Apr 24 20:41:46 GMT 2024

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

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

Back to the top