1

I have Created one Program Using Lwuit,Midlet. In that program I am showing Dialog box on the screen (LWUIT component) when I press mobile key. It shows default size. But I want to resize it.

How can I resize the Dialog Box in LWUIT?

gnat
  • 6,213
  • 108
  • 53
  • 73
Shankar
  • 31
  • 8

1 Answers1

4

Use this Dialog#Show method for showing resized Dialog. For example,

Dialog dialog = new Dialog("Information");
dialog.show(0, 100, 11, 11, true);
bharath
  • 14,283
  • 16
  • 57
  • 95
  • yes i got it bharath. again i want to close it.when i press some other key. i tried with dialog.Dispose(); . but it is not working. – Shankar Jan 10 '12 at 07:22
  • Dont use `Dispose()`. use [`dialog.dispose();`](http://lwuit.java.net/javadocs/com/sun/lwuit/Dialog.html#dispose()) – bharath Jan 10 '12 at 07:29
  • 2
    Shankar @bharath answer is OK.You should accept the answer who resolve your question. – frayab Jan 10 '12 at 09:21
  • Just update your code on your answer. Dont use comment for this. – bharath Jan 10 '12 at 09:36
  • --> d is an Object for dialog() public void keyPressed(int key){ switch(key) { -->50-55,57 are represents 2,3,4,5,6,7,8,9 case 50: case 51: case 52: case 53: case 54: case 55: case 57: d.show(180, 30, 5, 5, true); break; case 56: case 42: case 35: --> key # d.dispose(); break; } – Shankar Jan 10 '12 at 09:42
  • Have you debug your application? use `system.out.println` inside of case 35 and see the output. I think case 35 not executed. – bharath Jan 10 '12 at 09:45
  • So you need to find which is `#` key code. and use it inside that case. Also dispose inside of default case. – bharath Jan 10 '12 at 10:40