Skip to main content

the splash between two Forms

4 replies [Last post]
jit_vogel
Offline
Joined: 2008-06-27

Hi, guys.
It is really a nice toolkit library! thanks. But i met a problem, that is:
how can i make a splash between two forms? below is my programs, but it does not work.

DNSplash dnSplash = new DNSplash();
new Thread(dnSplash).start(); // a form is defined in this Thread

ConnTest test = new ConnTest();
String message = test.connTest(); // network connection

dnSplash.setDone();

Form f = new Form("test");
f.show;

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Shai Almog

Hi,
on which thread are you executing this code?
If this is the EDT thread (as a result of paint/event) then you are
essentially blocking painting etc...

Thanks,
Shai.

> Hi, guys.
> It is really a nice toolkit library! thanks. But i met a problem,
> that is:
> how can i make a splash between two forms? below is my programs,
> but it does not work.
>
>
> DNSplash dnSplash = new DNSplash();
> new Thread(dnSplash).start(); // a form is defined in this
> Thread
>
> ConnTest test = new ConnTest();
> String message = test.connTest(); // network connection
>
> dnSplash.setDone();
>
> Form f = new Form("test");
> f.show;
> [Message sent by forum member 'jit_vogel' (jit_vogel)]
>
> http://forums.java.net/jive/thread.jspa?messageID=282953
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

jit_vogel
Offline
Joined: 2008-06-27

hi,

thanks for the reply.

yes, this thread is in a result of event.
But for J2ME programm, it is totally normal, is it?
So , that means, we can not make the splash between two frames?

Shai Almog

Hi,
You can make a splash screen between two forms. Holding the MIDP
thread would cause a similar delay in MIDP too.
The solution is to do these things asynchronously either based on
events or through a thread. The simplest way for this is to just
spawn a thread from the command right after showing the splash and
construct your new form there.

If you want your code to be more organized and sequential and want to
dig into this further please read this:
http://lwuit.blogspot.com/2008/05/invokeandblock-foxtrot-inspired.html
There are also fine threads in this forum discussing the EDT/
threading issues as well as a some explanation in the developer guide.

Thanks,
Shai.

> hi,
>
> thanks for the reply.
>
> yes, this thread is in a result of event.
> But for J2ME programm, it is totally normal, is it?
> So , that means, we can not make the splash between two frames?
> [Message sent by forum member 'jit_vogel' (jit_vogel)]
>
> http://forums.java.net/jive/thread.jspa?messageID=282978
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

jit_vogel
Offline
Joined: 2008-06-27

OKOK, i solved the problem!

thanks very much!!!