Strange LWUIT Dialog behaviour while using Dialog.showPacked() with BorderLayout.CENTRE positioning

323 views Asked by At

I am using LWUIT for series 40 for making my J2ME app and I have noticed a strange behavior of the LWUIT-Dialog while using the showPacked() method, the dialog being positioned with BorderLayout.CENTER.

This happens especially in touch phones.

I have attached an image in order to describe my situation.

Image link

Initially the dialog appears as shown in the first part of the image.However,it expands in the next few seconds to become like the one shown in the second part of the image.

Future calls to display the dialog using showPacked appears like the third one.I am clueless as to why this is happening.I want my dialog to appear like the one shown in the first half of the image all the time.Where have I gone wrong?

Note : The content of the Dialog is a an animated label.

2

There are 2 answers

1
Shai Almog On

I have no idea what the guys did there but I'm guessing they reflow the UI too aggressively. Try setting Dialog.setAutoAdjustDialogSize(false) and see if it solves your problem.

0
Ajibola On

You can remove the title and background et al. with the code below, it makes only your animated GIF show with the dimmed dialog background :

setTitle(" ");
setUIID("Null");
setDialogUIID("Null");
getStyle().setBgTransparency(0);
getSelectedStyle().setBgTransparency(0);
getUnselectedStyle().setBgTransparency(0);
getPressedStyle().setBgTransparency(0);
getDialogStyle().setBgTransparency(0);