Oppure

Loading
23/10/09 6:55
Java5
Ciao Ragazzi
un aiuto! Ho sviluppato una GUI per un'agenda con eclipse usando i controlli swing attraverso una visual class chiamata Organizer_Gui.
il problema è che quando cerco ri mandare in run l'applicazione attraverso il menù run as => Java Bean ottengo il seguente errore:
"IWAV0048I Java Bean Organizer_Gui started with null constructor"
Cosa devo fare? ho fatto qualche ricerca in internet ma non sono riuscito a trovare niente di interessante.
Mi dareste una mano?
grazie.
aaa
24/10/09 14:29
netarrow
se lo esegui come application invece di bean da cmq il problema?
aaa
26/10/09 9:37
Java5
Ciao netarrow
ho letto in giro sulla guida di eclipse che quando si esegue un'applicazione col java bean il compilatore crea automaticamente una sorta di main che utilizza x lanciare l'applicazione.
Se inserisco il metodo main, infatti, ricevo un altro errore che mi segnala la presenza appunto del metodo main stesso.

Ho trovato in rete inoltre qs post:

That's not an error. That is simply a message to tell you that the Java Bean Application Launcher used the null constructor of your class to start it. That means your class was not a standard AWT/Swing subclass so it couldn't figure out a nicer way of starting it (like it would if it was a JFrame or a JPanel). We give this info because often when starting with the null constructor nothing visual happens and people get confused and don't realize it actually ran because the console would be empty.

When you actually write your application with its own main and use your class then this message won't show because the code that produces it won't be in your application.


In realtà io ho usato come contenitore principale non il solito JFrame ma un JInternalFrame e, non avendo esteso la sua classe come di solito si fa per il JFrame, non ho istanziato attraverso il metodo costruttore (super) le sue var. di istanza.

Credo a qs punto che quel msg lo ricevo proprio x questo motivo.
Mi domando allora se x creare un GUI bisogna usare come contenitore di base su cui appoggiare tutti gli altri controlli per forza un Frame o JFrame?

Ultima modifica effettuata da Java5 26/10/09 9:38
aaa
26/10/09 17:00
netarrow
Se usi un JInternalFrame deve stare dentro un JDesktopPane, che a sua volta deve stare dentro un Frame, JFrame o JDialog o in generale dentro una classe che estende Window.
aaa