Skip to main content



      Home
Home » Archived » Visual Editor (VE) » Run Java Bean using main method
Run Java Bean using main method [message #120778] Mon, 20 March 2006 19: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] Mon, 20 March 2006 21:21 Go to previous message
Eclipse UserFriend
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] Mon, 20 March 2006 21:21 Go to previous message
Eclipse UserFriend
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: Tue Jun 24 19:30:47 EDT 2025

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

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

Back to the top