0

I am using LWUIT but a problem I have is that when I use an image as a label like this:

mapScreen = new Form("Map");
        try 
        {
            Image image = Image.createImage("/res/Map_new_1.jpg");
            mapScreen.addComponent(new Label(image));
        } catch (Exception e) 
        {
            System.out.print("Error\n\n"+e.getMessage());
            mapScreen.addComponent(new Label(e.getMessage()));
        }

I am able to display the image even though it is larger than the screen of the mobile phone. I am also able to scroll vertically but I am not able to scroll horizontally. How can I fix this problem so that I will also be able to scroll horizontally?

Thanks.

arthurbc
  • 95
  • 7

2 Answers2

1

You can try to use Form.setScrollableX(true);

Mun0n
  • 4,438
  • 4
  • 28
  • 46
  • Hi jmunoz, I have tried it but still, I wasn't able to scroll horizontally. Do you know some other way to work around this? Thanks – arthurbc Mar 25 '12 at 20:59
  • are you sure that your image is bigger than the screen? – Mun0n Mar 25 '12 at 21:15
  • Yup. I am sure of that since I cannot see the other parts in the right side of the image but I can scroll up and down. Just the scroll horizontally doesn't work – arthurbc Mar 25 '12 at 22:44
0

You can try mapscreen.setScrollableX(true);

It will work. I have tried it. It's working correctly for me.

pjumble
  • 16,880
  • 6
  • 43
  • 51
Kalai Selvan Ravi
  • 2,846
  • 2
  • 16
  • 28