java me textfield - java-me

i want to have default text in a textfield which disappears when the textfield gets focus. similar to the google search box in firefox.
also with java me is it possible to set a background image for a display.

The answer of your second question is easy. Unless you use canvas, it is not possible.
AFAIK you cannot handle focus events on a textfield in J2ME so it is not possible.

Related

Is it possible to make a webkit webview transparent within the application like other gtk widgets?

I am writing a simple application with Python3, Gtk3 and Webkit2. One of the elements is a webview, but I want the webview to be transparent to the background set for the parent container - in this case a Gtk.Paned in a Gtk.Box where the GtK.Box can optionally have a background image set.
Most of the solutions I've found out there give you a webview that is transparent to the screen/desktop. Like this solution:
Is it possible to render web content over a clear background using WebKit?
This is not quite what I want. Is there any way to choose what webview is transparent to? Or another approach that produces the desired result?
Good question, but as far as I know it's not currently possible.

LWUIT Scrolling

Here is another question regarding JavaMe and LWUIT.
I need to manually scroll TextArea with help of methods or etc. TextArea contains methods responsible only for obtaining current position of scrolling and its enable and disable.
How can I do this?
I solved problem by using inheritance from TextArea and delegation protected methods of scrolling (setScrollX and setScrollY accordingly). Thanks to all!
TextArea extends TextField. In the TextField class there is the setCursorPosition method. So my suggestion is to use this method and you loop through the TextArea content until a certain position you desire is reached.
You can use scrollRectToVisible() which is often more convenient than scrollY and adds smooth scrolling animation.

In J2me lWUIT Library how to arrange long text on Label?

I am using LWUIT Library. I want to add same long information of project on AboutUS FORM. I'm using label but information become lost. If I am not using TextArea then what is another Solution?
My Another Question is,
In Login Form, what should be used TextField or TextArea?
Label is not good for showing long information. because its not allow to show multiple lines. Better you can use with TextArea and set the editable mode to false. If you dont want to use TextArea means just start the ticker on the Label.
Use TextField for login page.

inputAccessoryView not hide the view when -resignFirstResponder?

I have attached a toolbar with a UITextField and UIButton to the keyboard when it becomes the first responder via the user taping inside the textfield
textField.inputAccessoryView = theToolbar;
Problem is, the toolbar disappears when the keyboard is dismissed, thus preventing any further input.
Any ideas on how to make the toolbar go back to the bottom of the screen rather than off it completely?
I'm thinking a delegate method might help but Im really not too sure. It seems once the inputAccessoryView always the inputAccessoryView :(
Cheers
The input accessory view is automatically dismissed with the input view (the keyboard, in this case). Generally you do not want to have an input accessory view in your view hierarchy. Instead, if you want your toolbar to scroll up when the keyboard is shown, you should follow the guidelines for Managing the Keyboard.
You could try using an additional toolbar that is offscreen as the inputAccessoryView, which could "fake" the appearance of what you are trying to do. Alternatively, have you tried adding the toolbar back to the bottom of the screen using
[self.view addSubview:theToolbar];
when the keyboard reaches the bottom of the screen? You can use keyboard notifications for this.

Capturing Gestures over a UIWebView

I am trying to set up a simple iPad application that has a table view and when you select a row for that table it displays a (drilled down to) UIWebView displaying the selected web page (related to the row selected).
Once in the drilled-down-to view I want to capture EVERY touch and gesture (tap, swipe, pinch, etc) and do my own thing with them. Yes, I know this will make navigating and interacting with the web page displayed impossible, that's the idea.
I have found and played around with the Stack Overflow question that was answered by this wepage: http://mithin.in/2009/08/26/detecting-taps-and-events-on-uiwebview-the-right-way/ and I can't get gestures to work with idea.
Any suggestions would be greatly appreciated. Thanks!
UIWebView already has a lot of gestureRecognizer attached to them. It might be a good idea to remove all those gesture recognizer before adding yours, as a testing unit.
If your gesture recognizer works, that means you could basically store the default recognizer in a private array and as soon as you want to give normal behavior to your webview again, you "reset" the UIWebView recognizer

Resources