Skip to main content

TabbedPane little bug

3 replies [Last post]
kawaiimomo
Offline
Joined: 2008-07-10

Hi all,

I'm working with the new code drop. I was having focus issues (scrolling TextArea inside a TabbedPane) which are solved in this release, good, good :-)

Now you can scroll the TextArea till the end and then focus will jump to the next focusable item, normal behaviour to me.

In my case I have a label, a TabbedPane and a TextArea inside one of the tabs. The tabs are located at bottom, and I've noticed when i finish scrolling down the TextArea, the focus jump to the Label (Component 0), in the next movement the focus will be in the tabs.

It seems to me that focus on TabbedPane is not checking the Constraint/location of the tabs...

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
chen

Hi,
I haven't understood what's your desired behavior, can you send some
screenshots or code snippet.

Regards,
Chen

lwuit-users@mobileandembedded.org wrote:
> Hi all,
>
> I'm working with the new code drop. I was having focus issues (scrolling TextArea inside a TabbedPane) which are solved in this release, good, good :-)
>
> Now you can scroll the TextArea till the end and then focus will jump to the next focusable item, normal behaviour to me.
>
> In my case I have a label, a TabbedPane and a TextArea inside one of the tabs. The tabs are located at bottom, and I've noticed when i finish scrolling down the TextArea, the focus jump to the Label (Component 0), in the next movement the focus will be in the tabs.
>
> It seems to me that focus on TabbedPane is not checking the Constraint/location of the tabs...
> [Message sent by forum member 'kawaiimomo' (kawaiimomo)]
>
> http://forums.java.net/jive/thread.jspa?messageID=286686
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

kawaiimomo
Offline
Joined: 2008-07-10

I just create in this order:
- Label
- TabbedPane (with tabs at [b]bottom[/b])
- TextArea (inside one of the tabs)

I made the Label focusable, so it gets the first focus. If I move down the tabs get selected (instead of the content of the tab (TextArea or whatever), which is in first place graphically speaking). If I move down again, the TextArea inside the tab is selected. If I move down again, the Label is selected.

For me the expected behaviour would be to select label, component in tab, tab, and again label.

Here are 2 screenshoots:

[url]http://www.4shared.com/file/55269190/24a269e9/tab_pos_focus2.html?[/url]

In that way, the focus behaviour is strange

[url]http://www.4shared.com/file/55269191/53a5597f/tab_pos_focus1.html?[/url]

In this other pic, is the expected. I think the TabbedPaned should check where its tabs are located. It's not the same to change focus to the next Component, being a TabbedPane, with bottom aligned tabs than with top aligned ones.

Here's the code:

[code]
Image img = null;
Form form = new Form();
form.setScrollable(false);
form.setLayout(new BoxLayout(BoxLayout.Y_AXIS));

try {
img = Image.createImage("/coke.jpg");
} catch (java.io.IOException e) {
e.printStackTrace();
}

form.setTransitionInAnimator(Transition3D.createCube(500, false));

Label lab = new Label("Coke Can");
lab.setFocusable(true);
lab.setIcon(img);
lab.setTextPosition(Component.LEFT);
lab.setAlignment(Component.RIGHT);

TabbedPane pane = new TabbedPane(Component.BOTTOM);
TextArea infoArea = new TextArea("Interfaces and API's of the underlying profile are abstracted by internal toolkit interfaces and abstract classes. This allows portability and a migration path for both current and future devices and profiles. E.g. the graphics object of the underlying profile would be encapsulated by Graphics. The toolkit tries to avoid the \"lowest common denominator\" mentality by implementing some missing features in the lower end platforms and taking better advantage of higher end platforms.", 10,10);

Container tab2 = new Container();
tab2.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
Label l1 = new Label("Hello there");
Label l2 = new Label("Bye^2");
l1.setFocusable(true);
l2.setFocusable(true);
tab2.addComponent(l1);
tab2.addComponent(l2);

pane.addTab("Supermarket", infoArea);
pane.addTab("Internet", tab2);

form.addComponent(lab);
form.addComponent(pane);

form.addCommand(new Command("something", 3));
form.setCommandListener(this);

form.show();
[/code]

Hope I make myself understandable ;-)

Regards

chen

Got it, we will fix for next version.

Thanks,
Chen

lwuit-users@mobileandembedded.org wrote:
> I just create in this order:
> - Label
> - TabbedPane (with tabs at [b]bottom[/b])
> - TextArea (inside one of the tabs)
>
> I made the Label focusable, so it gets the first focus. If I move down the tabs get selected (instead of the content of the tab (TextArea or whatever), which is in first place graphically speaking). If I move down again, the TextArea inside the tab is selected. If I move down again, the Label is selected.
>
> For me the expected behaviour would be to select label, component in tab, tab, and again label.
>
>
> Here are 2 screenshoots:
>
> [url]http://www.4shared.com/file/55269190/24a269e9/tab_pos_focus2.html?[/url]
>
> In that way, the focus behaviour is strange
>
>
> [url]http://www.4shared.com/file/55269191/53a5597f/tab_pos_focus1.html?[/url]
>
> In this other pic, is the expected. I think the TabbedPaned should check where its tabs are located. It's not the same to change focus to the next Component, being a TabbedPane, with bottom aligned tabs than with top aligned ones.
>
>
> Here's the code:
>
> [code]
> Image img = null;
> Form form = new Form();
> form.setScrollable(false);
> form.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
>
> try {
> img = Image.createImage("/coke.jpg");
> } catch (java.io.IOException e) {
> e.printStackTrace();
> }
>
> form.setTransitionInAnimator(Transition3D.createCube(500, false));
>
> Label lab = new Label("Coke Can");
> lab.setFocusable(true);
> lab.setIcon(img);
> lab.setTextPosition(Component.LEFT);
> lab.setAlignment(Component.RIGHT);
>
> TabbedPane pane = new TabbedPane(Component.BOTTOM);
> TextArea infoArea = new TextArea("Interfaces and API's of the underlying profile are abstracted by internal toolkit interfaces and abstract classes. This allows portability and a migration path for both current and future devices and profiles. E.g. the graphics object of the underlying profile would be encapsulated by Graphics. The toolkit tries to avoid the \"lowest common denominator\" mentality by implementing some missing features in the lower end platforms and taking better advantage of higher end platforms.", 10,10);
>
> Container tab2 = new Container();
> tab2.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
> Label l1 = new Label("Hello there");
> Label l2 = new Label("Bye^2");
> l1.setFocusable(true);
> l2.setFocusable(true);
> tab2.addComponent(l1);
> tab2.addComponent(l2);
>
> pane.addTab("Supermarket", infoArea);
> pane.addTab("Internet", tab2);
>
> form.addComponent(lab);
> form.addComponent(pane);
>
> form.addCommand(new Command("something", 3));
> form.setCommandListener(this);
>
> form.show();
> [/code]
>
> Hope I make myself understandable ;-)
>
> Regards
> [Message sent by forum member 'kawaiimomo' (kawaiimomo)]
>
> http://forums.java.net/jive/thread.jspa?messageID=286730
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net