Skip to main content

new StateMachine("/mytheme.res"); New instance is ignored ->Empty statemachinebase.

Please note these forums are being decommissioned and use the new and improved forums at
1 reply [Last post]
Joined: 2011-03-31

hello I recently started using Resource editor and I have a question:I 'm trying to create a simple project just for test purposes in Resource Editor:nothing special just a Label with a hello world, but when I push "create Netbeans project" while all the projects(JavaSE,MIDP ,RIM) are created none of them are running. In normal JaVA I just get a black screen and in MIDP emulator I get a message saying "This application runs in the background".
My StateMachineBase code is this

[prettify]<span class="kwd">public</span><span class="pln"> </span><span class="kwd">class</span><span class="pln"> </span><span class="typ">StateMachineBase</span><span class="pln"> </span><span class="pun">{ </span><span class="pln"><br />    </span><span class="kwd">public</span><span class="pln"> </span><span class="typ">StateMachineBase</span><span class="pun">(</span><span class="typ">String</span><span class="pln"> s</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{} </span><span class="pln"><br /></span><span class="pun">}</span><span class="pln"><br /></span>[/prettify]
And My StateMachine code is this:

[prettify]<span class="kwd">public</span><span class="pln"> </span><span class="typ">StateMachine</span><span class="pun">(</span><span class="typ">String</span><span class="pln"> resFile</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{ </span><span class="pln"><br />    </span><span class="kwd">super</span><span class="pun">(</span><span class="pln">resFile</span><span class="pun">); </span><span class="pln"><br />    </span><span class="com">// do not modify, write code in initVars and initialize class members there, </span><span class="pln"><br />    </span><span class="com">// the constructor might be invoked too late due to race conditions that might occur </span><span class="pln"><br /></span><span class="pun">}</span><span class="pln"><br /><br /></span><span class="com">/** <br /> * this method should be used to initialize variables instead of <br /> * the constructor/class scope to avoid race conditions <br /> */ </span><span class="pln"><br /></span><span class="kwd">protected</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> initVars</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{ </span><span class="pln"><br /></span><span class="pun">}</span><span class="pln"><br /></span>[/prettify]

So I'm guessing my prgramm obviously won't do anything since there is no code. What am I doing wrong? From my understanding StateMachineBase should have all the boiler code.I'm using Netbeans 6.9.1 ,Lwuit latest version and JavaME SDK 3.0 and Nokia S60 SDK.

Also another thing: In the MainMidlet .Java I have this code
public void run() {
new StateMachine("/mytheme.res");
With the warning "New instance is ignored. And when I try to run the application I get a message "this application runs only in the background". And in the Desktop version I just get a black screen.I also tried to create a theme an to insert a ready-user-info template and THEN create a netbeans project but still I get the same empty code.
Any ideas?
Thank you.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-11-07