Hello All,
I am using LWUIT for the Series 40 below.
http://projects.developer.nokia.com/LWUIT_for_Series_40
I am using the S40-no-themes.jar.
I have the sample code below. The problem, I'm having is when I select the "Hello" button, the text will jump to LEFT. Can anyone help me. Thanks in advance.
Code:import javax.microedition.midlet.*; import com.sun.lwuit.*; import com.sun.lwuit.events.*; import com.sun.lwuit.layouts.BoxLayout; public class HelloWorld extends MIDlet implements ActionListener { public void startApp() { Display.init(this); Form f = new Form("Hello, LWUIT!"); f.setLayout(new BoxLayout(BoxLayout.Y_AXIS)); Button hello = new Button("Hello"); hello.getStyle().setAlignment(Component.CENTER); hello.getSelectedStyle().setAlignment(Component.CENTER); f.addComponent(hello); f.show(); Command exitCommand = new Command("Exit"); f.addCommand(exitCommand); f.addCommandListener(this); } public void pauseApp() {} public void destroyApp(boolean unconditional) {} public void actionPerformed(ActionEvent ae) { notifyDestroyed(); } }

Reply With Quote


