Skip to main content

LWUIT in Netbeans

10 replies [Last post]
loadbrain
Offline
Joined: 2008-05-14
Points: 0

Hi,
How do I embedd LWUIT in Netbeans?
So I can use it as described in the Tutorial (http://lwuit.dev.java.net/nonav/tutorial/index.html)?

Reply viewing options

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

Hi again,

Seems to me for almost all leading mobile application software vendors, e.g. Nokia’s Widsets, the focus on a list will always try to stay off either the bottom or the top so that a user could have a better view of what is available to him.

I have noticed that the LWUIT’s design is still following the old approach, e.g. if the list (including command menu handling) is longer than the screen height, when the use scrolls the list from top to the bottom, the focus will move from the top, gradually to the item closest to the bottom and stays there while moving the list upwards.

Comparing with widsets’ approach, this does not seem to give a satisfactory user experience. Although this may look trivial, it may be used to distinguish between an improved design and an old/desktop one.

I would highly suggest this issue to be reviewed or indeed to be re-designed and implemented. A suggestion is the focus would try to stay at the golden division – “0.618” (either top when moving focus up on the list, or bottom, when moving focus down the list).

Many thanks,

Qunhuan

chen

Hi Qunhuan,
You can set the List behavior by using the List.setFixedSelection(int
fixedSelection) method.
Let me know if that answers your needs.

Regards,
Chen

Qunhuan Mei wrote:
> Hi again,
>
> Seems to me for almost all leading mobile application software vendors, e.g. Nokia’s Widsets, the focus on a list will always try to stay off either the bottom or the top so that a user could have a better view of what is available to him.
>
> I have noticed that the LWUIT’s design is still following the old approach, e.g. if the list (including command menu handling) is longer than the screen height, when the use scrolls the list from top to the bottom, the focus will move from the top, gradually to the item closest to the bottom and stays there while moving the list upwards.
>
> Comparing with widsets’ approach, this does not seem to give a satisfactory user experience. Although this may look trivial, it may be used to distinguish between an improved design and an old/desktop one.
>
> I would highly suggest this issue to be reviewed or indeed to be re-designed and implemented. A suggestion is the focus would try to stay at the golden division – “0.618” (either top when moving focus up on the list, or bottom, when moving focus down the list).
>
> Many thanks,
>
> Qunhuan
>

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

Qunhuan Mei

Hi Chen,

Glad to know the List can already set some selection positions. I missed this, sorry.

Just tried all FIXED_NONE, FIXED_TRAIL, FIXED_LEAD, FIXED_CENTER, FIXED_NONE_CYCLIC. I am most interested in FIXED_CENTER. This always give a user what is available both at top and bottom. My slight concern is that this design might not coincide with user's natural expectation of a list - i.e. it has a physical top and bottom and is NONE_CYCLIC.

Personally, I would like to see the selection is positioned in the centre when there is more item to come into the screen. However, when all items are on the screen, e.g. moving selection upwards and item 1 is visible, then the selection should move its position upwards while keeping the list items still.

Just a thought.

Many thanks,

Qunhuan

-----Original Message-----
From: Chen.Fishbein@Sun.COM [mailto:Chen.Fishbein@Sun.COM]
Sent: 11 June 2008 12:55
To: users@lwuit.dev.java.net
Subject: Re: List focus issue and a suggestion

Hi Qunhuan,
You can set the List behavior by using the List.setFixedSelection(int
fixedSelection) method.
Let me know if that answers your needs.

Regards,
Chen

Qunhuan Mei wrote:
> Hi again,
>
> Seems to me for almost all leading mobile application software vendors, e.g. Nokia’s Widsets, the focus on a list will always try to stay off either the bottom or the top so that a user could have a better view of what is available to him.
>
> I have noticed that the LWUIT’s design is still following the old approach, e.g. if the list (including command menu handling) is longer than the screen height, when the use scrolls the list from top to the bottom, the focus will move from the top, gradually to the item closest to the bottom and stays there while moving the list upwards.
>
> Comparing with widsets’ approach, this does not seem to give a satisfactory user experience. Although this may look trivial, it may be used to distinguish between an improved design and an old/desktop one.
>
> I would highly suggest this issue to be reviewed or indeed to be re-designed and implemented. A suggestion is the focus would try to stay at the golden division – “0.618” (either top when moving focus up on the list, or bottom, when moving focus down the list).
>
> Many thanks,
>
> Qunhuan
>

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

chen

Hi,
First create your mobile project then goto project properties->Libraries
& Resources->Add Jar/Zip and selects the LWUIT.jar
file.

Regards,
Chen

lwuit-users@mobileandembedded.org wrote:
> Hi,
> How do I embedd LWUIT in Netbeans?
> So I can use it as described in the Tutorial (http://lwuit.dev.java.net/nonav/tutorial/index.html)?
> [Message sent by forum member 'loadbrain' (loadbrain)]
>
> http://forums.java.net/jive/thread.jspa?messageID=279396
>
> ---------------------------------------------------------------------
> 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

loadbrain
Offline
Joined: 2008-05-14
Points: 0

I already did this to an existing project but where can I now choose to use the LWUIT?
I can not find it anywhere...

Jonathan Knudsen

It's explained in the tutorial:

https://lwuit.dev.java.net/nonav/tutorial/hello.html

Does that help?

Regards,
Jonathan

On Jun 10, 2008, at 12:16 PM, lwuit-users@mobileandembedded.org wrote:
> I already did this to an existing project but where can I now choose
> to use the LWUIT?
> I can not find it anywhere...
> [Message sent by forum member 'loadbrain' (loadbrain)]
>
> http://forums.java.net/jive/thread.jspa?messageID=279477
>
> ---------------------------------------------------------------------
> 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

loadbrain
Offline
Joined: 2008-05-14
Points: 0

Yes.
Sorry, I was mistaken, I thought I have to choose an Emulator Platform...
Everything is working fine.
Thanks al lot!!!

Matteo Mazzotti

Hi,
I've not perfectly understood how ListModel works.
See the code below:

Class Menu extends List{

private final ListModel model = new DefaultListModel();

public Menu(){
for (some condition){
model.addItem(someItem);
}
this.setModel(model);
}

public void removeItem(int index){
model.removeItem(index);
}

private class MyRenderer extends ListCellRendere{}
}

When I call removeItem on the Menu instance, nothing happens to the view
List.
How can I tell the List to redraw/update as the underlying model has
changed?

Thanks
Matteo

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

chen

Hi Matteo,
This functionality suppose to work, if you are using the
DefaultListModel all the data changed events suppose to refresh the List
for you.

You can try this simple use case:

Form test = new Form("test");
test.setLayout(new BorderLayout());
//this constructor will create a DefaultListModel in the List
List list = new List(new Object[]{"item1", "item2", "item3",
"item4", "item5"});
test.addComponent(BorderLayout.CENTER, list);
test.show();
int size = list.size();
for (int i = 0; i < size; i++) {
try {
Thread.sleep(500);
} catch (InterruptedException ex) {
ex.printStackTrace();
}
list.getModel().removeItem(list.size() - 1);
}

Is there any chance you have tried to implement the model yourself? and
you didn't implemented the *public void
addDataChangedListener(DataChangedListener l) *and the *public void
removeDataChangedListener(DataChangedListener l)* methods?

Regards,
Chen

Matteo Mazzotti wrote:
> Hi,
> I've not perfectly understood how ListModel works.
> See the code below:
>
> Class Menu extends List{
>
> private final ListModel model = new DefaultListModel();
>
> public Menu(){
> for (some condition){
> model.addItem(someItem);
> }
> this.setModel(model);
> }
>
> public void removeItem(int index){
> model.removeItem(index);
> }
>
> private class MyRenderer extends ListCellRendere{}
> }
>
>
> When I call removeItem on the Menu instance, nothing happens to the view
> List.
> How can I tell the List to redraw/update as the underlying model has
> changed?
>
>
> Thanks
> Matteo
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>
>

[att1.html]

Matteo Mazzotti

Hi,
calling list.getModel().removeItem(index) works, whereas what I was trying
to do (removing the item directly from the model, instead of getting the
model out of the list) does not... strange.

thanks,
matteo

_____

Da: Chen.Fishbein@Sun.COM [mailto:Chen.Fishbein@Sun.COM]
Inviato: mercoledì 11 giugno 2008 13.33
A: users@lwuit.dev.java.net
Oggetto: Re: ListModel explanation

Hi Matteo,
This functionality suppose to work, if you are using the DefaultListModel
all the data changed events suppose to refresh the List for you.

You can try this simple use case:

Form test = new Form("test");
test.setLayout(new BorderLayout());
//this constructor will create a DefaultListModel in the List
List list = new List(new Object[]{"item1", "item2", "item3",
"item4", "item5"});
test.addComponent(BorderLayout.CENTER, list);
test.show();
int size = list.size();
for (int i = 0; i < size; i++) {
try {
Thread.sleep(500);
} catch (InterruptedException ex) {
ex.printStackTrace();
}
list.getModel().removeItem(list.size() - 1);
}

Is there any chance you have tried to implement the model yourself? and you
didn't implemented the public void
addDataChangedListener(DataChangedListener l) and the public void
removeDataChangedListener(DataChangedListener l) methods?

Regards,
Chen

Matteo Mazzotti wrote:

Hi,

I've not perfectly understood how ListModel works.

See the code below:

Class Menu extends List{

private final ListModel model = new DefaultListModel();

public Menu(){

for (some condition){

model.addItem(someItem);

}

this.setModel(model);

}

public void removeItem(int index){

model.removeItem(index);

}

private class MyRenderer extends ListCellRendere{}

}

When I call removeItem on the Menu instance, nothing happens to the view

List.

How can I tell the List to redraw/update as the underlying model has

changed?

Thanks

Matteo

---------------------------------------------------------------------

To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net

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

[att1.html]