Is it possible to customise the title bar in Java ME?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The API doesn’t provide functionality for customising the default title bar, but we can attempt to write our own bar. This is in itself a minor breach of UI conventions. Some phones allow us to use
setTitle(null)to remove the title. The phones in the Java mobile toolkit behave this way, but the Series 40 and 60 emulators don’t seem to support this and instead generates a default title. On the other hand, the Sony Ericssons and Motorolas I’ve tested seem to support this.However, we can detect whether the ability to remove the titlebar is present. We do not use the
sizeChangedcallback as the calling of this function may be delayed when the canvas is not visible. Instead we callgetHeightboth before and after removing the bar. According to the spec,getHeightshould always return the correct and up to date value, even when the canvas is not being displayed. Here is code for implementing the detection:It is also possible to hide the title bar using full screen mode, but this hides other elements as well. This method is popular in games.