Hi

Maybe you want to have a look to Apache DeltaSpike CdiContainer:
http://deltaspike.apache.org/documentation.html#start-a-cdi-container-using-java-se

For OpenEJB a common pattern is:


public static void main(String[] a) {
    Main main = new Main();

    container = EJBContainer.createEJBContainer(/* props if needed */);
    container.getContext().bind("inject", main);

   main.doMain(a); // real main

}

Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2013/9/18 mauro2java2011 <[email protected]>:
> but with a Class :
>
> import javax.swing.*;
>
> public class MyPersonalApplication {
> JForm form;
> JPanel panel;
> JButton button;
>
> // i have to inject like below a instance of it?????
> @Siingleton
>  @Startup
> private MyPersonalApplication myPersonalApplication;
>
> //constructor
> public MyPersonalApplication (){
>  form =new JForm();
> panel= new JPanel();
> button=new JButton();
> //other code for initialize components swing and add the listener......
> panel.add(button();
>
> form.getContentPane.add(panel);
> form.pack();
>
>
> JPanel panel;
> JButton button;
> }
>
> }
>
>
> hi hjave to inject a instance of the sanme class?
> i have to wirte also a method man(String[]arg){
>
> //
> }
> or  not ???
>
> 2) what jars i have to put int othe classpath of SE applicatio nswing for
> get OpenwebBeans to work???
>
>
>
>
> --
> View this message in context: 
> http://openejb.979440.n4.nabble.com/bootstrap-openwebbeans-into-java-se-application-tp4665109p4665122.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Reply via email to