I am developing a midlet using eswt. It has a image at the top, browser at the middle and the footer image at the bottom
My code is
When I start the application the layout shows correctly with 2 images with the browser. After few seconds the browser stretches itself in such a way, the image below the browser hides itself. Is there any way to stop resizing the browser? or is there any other way to render the browser with the 2 images correctly?Code:demoShell = new Shell(SWT.MAX); demoShell.setText("Browser"); demoShell.setLayout(new RowLayout(SWT.HORIZONTAL)); demoShell.setSize(240,320); demoShell.layout(); closeCommand = new Command(demoShell, Command.EXIT, 0); closeCommand.setText("Close"); closeCommand.addSelectionListener(this); InputStream is = getClass().getResourceAsStream("/footer.gif"); angryImage = new Image(demoShell.getDisplay(), is); img = new Label(demoShell, SWT.TOP); img.setImage(angryImage); backCommand = new Command(demoShell, Command.BACK, 0); backCommand.setText("Back"); backCommand.addSelectionListener(this); forwardCommand = new Command(demoShell, Command.OK, 0); forwardCommand.setText("Forward"); forwardCommand.addSelectionListener(this); goToWebPageCommand = new Command(demoShell, Command.OK, 0); goToWebPageCommand.setText("Go To Web Page"); goToWebPageCommand.addSelectionListener(this); //create the browser browser = new Browser(demoShell, SWT.NONE); //browser.setSize(260, 240); browser.setBounds(5, 75, 240, 100); browser.pack(false); img = new Label(demoShell, SWT.BOTTOM); img.setImage(angryImage); demoShell.open(); demoShell.setActive(); //browse to nokia.com browser.setUrl("http://forumnokia.mobi");
Thanks in advance,
Girish

Reply With Quote

