Jul 19, 2013

Pull Down to Refresh for LWUIT

Hi, all

I believe most of you here have heard about "Pull Down to Refresh" gesture. Shortly, it is a very used gesture on iOS apps, created by Loren Brichter, which users perform to refresh contents on the screen, just pulling down a list using the thumb.

So, now that you are contextualized about "Pull Down Refresh", I would like to inform that this famous gesture has just arrived to Java ME/LWUIT world.

Pull Down to Refresh for LWUIT was an old idea of mine, but just this week I sat down and decided to code a component that implemented this gesture. I was not sure whether it was going to work, but for my surprise it worked, and you will see how easy it is to get it integrated into your apps.

...
Form form = new Form("PullDownRefresh") {};
form.setLayout(new BorderLayout());
//
List list = new List(new String[] {...});
list.setRenderer(new DefaultListCellRenderer());
//
final PullDownRefresh refresher = new PullDownRefresh();
refresher.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
        new Thread() {
            public void run() {
                // Perform some process
                //
                refresher.endRefreshing();
            }
        }.start();
    }
});
//
form.addComponent(BorderLayout.NORTH, refresher);
form.addComponent(BorderLayout.CENTER, list);
//
form.show();
...

As you can see in the code snippet above, all you have to do is to create an instance of PullDownRefresh class and add it at first position of a Form object and register an ActionListener object to be notified when a refresh operation is triggered. With this notification, you can start a process to perform any operation, e.g., refresh the Form's data. Once the operation is concluded, just call the endRefreshing() method, so the component can return to its default state. Easy, huh?

Watch the video below and see PullDownRefresh component in action:



Cool, huh? :)

PullDownRefresh component is totally customizable. For instance, you can change the style, images and labels. Check out the Javadoc and you will know how.

You can download the component right away by clicking here. Besides the source code, there is also sample MIDlet.

By the way, PullDownRefresh is under MIT license.

I hope everybody finds this new component useful and let me know your comments.

See you in the next post...

Update (Feb 17th, 2014):

There is a new version of this component. For further details, check this post.

48 comments:

Stanyy said...

Hi Ernandes, is there a recent J2ME app for blogger? The old ones like Blogplanet and Kablog no longer work because google changed the blogger interface. If you could make one, It'd be very useful to a lot of people. Thanks

Ernandes Mourão Júnior said...

Sorry, I know none.

I will think about it. :)

Anonymous said...

Hi. I'm trying to use PullDownRefresh in my app. Everything works except that when the form loads the bar is already visible. It doesn't hide until pulled. Any ideas?

Ernandes Mourão Júnior said...

Is it the first component in your form?

Are you calling beginRefreshing() method during the form load? If so, remove it.

Unknown said...

Great and Useful Article.

Online Java Course

Java Online Training

Java Course Online

Best Recommended books for Spring framework

Java Interview Questions












Java Training Institutes in Chennai

Java Training in Chennai

J2EE Training in Chennai

java j2ee training institutes in chennai

Java Course in Chennai

Unknown said...

thank you for sharing such a nice and interesting blog with us. hope it might be much useful for us. keep on updating...
ROI Services in Chennai

nilashri said...

The knowledge of technology you have been sharing thorough this post is very much helpful to develop new idea. here by i also want to share this.
Data Science Training in Chennai
Data science training in bangalore
Data science online training
Data science training in pune
Data science training in kalyan nagar

Unknown said...

Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and I got more information from your blog.
Devops training in Chennai
Devops training in Bangalore
Devops Online training
Devops training in Pune

simbu said...

It is better to engaged ourselves in activities we like. I liked the post. Thanks for sharing.

java training in chennai | java training in bangalore

java online training | java training in pune

selenium training in chennai

selenium training in bangalore

ganga said...


I would like to thank you for your nicely written post, its informative and your writing style encouraged me to read it till end. Thanks

angularjs-Training in annanagar

angularjs Training in chennai

angularjs Training in chennai

angularjs Training in bangalore

Unknown said...

Impressive. Your story always bring hope and new energy. Keep up the good work.
python online training
python training in OMR
python training course in chennai

Anonymous said...

Thank you for an additional great post. Exactly where else could anybody get that kind of facts in this kind of a ideal way of writing? I have a presentation next week, and I’m around the appear for this kind of data.

angularjs Training in marathahalli

angularjs interview questions and answers

angularjs Training in bangalore

angularjs Training in bangalore

angularjs Training in chennai

automation anywhere online Training

Sharmi Ammu said...

I would like to say that this blog really convinced me to update my knowledge about the technology you talk about. Thanks, very good post


Selenium Training in Chennai
Selenium Course in Chennai
iOS Course in Chennai
French Classes in Chennai
Big Data Training in Chennai
SEO Course in Chennai
SEO Training Institute in Chennai

Vicky Ram said...

Great article. Thanks for sharing.

opencu
Guest posting sites

rohini said...

iphone service center chennai
iphone service center
ipad service center chennai
ipad service center
imac service center chennai
imac service center

Jvimala said...

Really awesome blog. Your blog is really useful for me
Regards,
Best Devops Training in Chennai | Best Devops Training Institute in Chennai

Raji said...

Very nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.
Devops Training in Chennai | Devops Training Institute in Chennai

spot said...

super your post in the website
honeymoon packages in andaman
andaman tour packages
andaman holiday packages
andaman tourism package
laptop service center in chennai
website designers in chennai
web development company in chennai
website designing company in chennai

anusha said...




MEAN Stack Training in Chennai MEAN Stack Training in Chennai with real time projects. We are Best MEAN Stack Training Institute in Chennai. Our Mean Stack courses are taught by Industrial Experts which would help you to learn MEAN Stack development from the scratch.

vijay said...

Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.

aws Training in Bangalore
python Training in Bangalore
hadoop Training in Bangalore
angular js Training in Bangalore
bigdata analytics Training in Bangalore
python Training in Bangalore
aws Training in Bangalore

ammu said...

very nice..
inplant training in chennai
inplant training in chennai
inplant training in chennai
brunei darussalam web hosting
costa rica web hosting
costa rica web hosting
hong kong web hosting
jordan web hosting
turkey web hosting
gibraltar web hosting

shiv said...

nice...................
inplant training in chennai
inplant training in chennai
inplant training in chennai for it.php
algeeria hosting
angola hostig
shared hosting
bangladesh hosting
botswana hosting
central african republi hosting
shared hosting

preethi minion said...

awesome
inplant training in chennai
inplant training in chennai
inplant training in chennai for it.php
italy web hosting
afghanistan hosting
angola hosting
afghanistan web hosting
bahrain web hosting
belize web hosting
india shared web hosting

ammu said...

good blogs.....!!!
chile web hosting
colombia web hosting
croatia web hosting
cyprus web hosting
bahrain web hosting
india web hosting
iran web hosting
kazakhstan web hosting
korea web hosting
moldova web hosting

ammu said...

very good blogs....
text animation css
animation css background
sliding menu
hover css
css text animation
css loaders
dropdown menu
buttons with css

hari said...

nice........
inplant training in chennai
inplant training in chennai
online python internship
online web design
online machine learning internship
online internet of things internship
online cloud computing internship
online Robotics
online penetration testing

hari said...

very good.....
internship in bangalore for cse students
internship for aerospace engineering students in india
core companies in coimbatore for ece internship
paid internship in pune for computer engineering students
automobile internship in chennai
internship in chennai for eee with stipend
internship for bca students
dotnet training in chennai
aeronautical engineering internship
inplant training for ece students

preethi minion said...

Awesome blogs.....
robotics courses
inplant training in chennai for eee students
paid internships in hyderabad for cse students
list of architectural firms for internship in india
internship for mca students
matlab training in chennai
final year project for it
internship for production engineering students
aeronautical internship
inplant training report for civil engineering

shalini said...


good.....
kaashiv infotech pune
industrial training report for electronics and communication
internships for cse
internship for automobile engineering students in bangalore
internships in bangalore for eee students
internship for civil engineering students in chennai 2019
internship in automobile companies in chennai
robotics chennai
final year projects for information technology

Praisy Margret said...

good..nice..
internships in bangalore for ece students 2019
internship for aeronautical engineering students in bangalore
kaashiv infotech chennai
internship for ece students in bangalore 2018
internship in chennai for eee with stipend
internship in chennai for mechanical engineering students
kaashiv infotech hyderabad
kaashiv infotech internship
internship in chennai for cse 2019
internship in aeronautical engineering

Durai Moorthy said...

I am really happy with your blog because your article is very unique and powerful for new reader.
aws Training in Bangalore
python Training in Bangalore
hadoop Training in Bangalore
angular js Training in Bangalore
bigdata analytics Training in Bangalore
python Training in Bangalore
aws Training in Bangalore

Rajesh Anbu said...

Thank you for sharing information. Wonderful blog & good post.
aws Training in Bangalore
python Training in Bangalore
hadoop Training in Bangalore
angular js Training in Bangalore
bigdata analytics Training in Bangalore
python Training in Bangalore
aws Training in Bangalore

Kerrthika K said...

Thank you much more for sharing the wonderful post. Keep updating here...
Advanced Excel Course in Chennai
Advanced Excel Training
Linux Training in Chennai
Graphic Design Courses in Chennai
Pega Training in Chennai
Tableau Training in Chennai
Oracle DBA Training in Chennai
Oracle Training in Chennai
Unix Training in Chennai
JMeter Training in Chennai
Advanced Excel Training in Chennai

Shanejo said...

It's very useful blog post with inforamtive and insightful content and i had good experience with this information.I have gone through CRS Info Solutions Home which really nice. Learn more details About Us of CRS info solutions. Here you can see the Courses CRS Info Solutions full list.Find the best Hadoop Training with great faculty. Go to know about crs info solutions Workday Training program.

Rashika said...

Thanks for sharing article. The way you have stated everything above is quite awesome. Keep blogging like this. Thanks.
AWS training in chennai | AWS training in annanagar | AWS training in omr | AWS training in porur | AWS training in tambaram | AWS training in velachery

TIC Academy said...

Great Blog. Thnaks.
SAP Training in Chennai
Java Training in Chennai
Software Testing Training in Chennai
.Net Training in Chennai
Hardware and Networking Training in Chennai
AWS Training in Chennai
Azure Training in Chennai
Selenium Training in Chennai
QTP Training in Chennai
Android Training in Chennai

Marry07 said...

If you are looking for a job oriented practical based workday course syllabus curriculum at Workday training institutes in India then you are arrived at the right place called Workday training institutes in ameerpet because this institute is quite popular for this wonderful course not just in Workday training institutes in Jaipur and also proving job assistance for Workday training institutes in Pune

Aadhya said...

Myself so glad to establish your blog entry since it's actually quite instructive. If it's not too much trouble continue composing this sort of web journals and I normally visit this blog. Examine my administrations.  
Read these Salesforce Admin Certification Topics which are really helpful. I read these Salesforce Admin and Developer Certification Dumps and very much useful for me. I recommend this Salesforce Developer Training and Certification Course for you.

Keerthi said...


360DigiTMG, Indore is a leading solutions provider of Training and Consulting to assist students, professionals by delivering top-notch, world-class classroom and online training. It offers courses in artificial intelligence training in indore.

Nick569 said...

Great post! I am actually getting ready to across this information, It’s very helpful for this blog. Also great with all of the valuable information you have Keep up the good work you are doing well.
CRS Info Solutions Salesforce training for beginners

meritstep Technology said...

Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
workday studio online training
best workday studio online training
top workday studio online training

devi said...

I like your post. Everyone should do read this blog. Because this blog is important for all now I will share this post. Thank you so much for share with us.
Data Science Training In Chennai | Certification | Data Science Courses in Chennai | Data Science Training In Bangalore | Certification | Data Science Courses in Bangalore | Data Science Training In Hyderabad | Certification | Data Science Courses in hyderabad | Data Science Training In Coimbatore | Certification | Data Science Courses in Coimbatore | Data Science Training | Certification | Data Science Online Training Course

360digitmgas said...

Excellent Blog! I would like to thank for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. I wanted to thank you for this websites! Thanks for sharing. Great websites! data science training in coimbatore

Aadhya said...

Myself so glad to establish your blog entry since it's actually quite instructive. If it's not too much trouble continue composing this sort of web journal and I normally visit this blog. Examine my administrations.  
Read these Salesforce Admin Certification Topics which are really helpful. I read these Salesforce Admin and Developer Certification Dumps and very much useful for me. I recommend this Salesforce Developer Training and Certification Course for you.  

Vennala said...

I am so happy to found your blog post because it's really very informative. Please keep writing this kind of blogs and I regularly visit this blog. Have a look at my services.
I have found this Salesforce training in India worth joining course. Try this Salesforce training in Hyderabad with job assistance. Join Salesforce training institutes in ameerpet with certification. Enroll for Salesforce online training in hyderabad with hands on course.

Eva.William said...

Get real time project based and job oriented Salesforce training India course materials for Salesforce Certification with securing a practice org, database terminology, admin and user interface navigation and custom fields creation, reports & analytics, security, customization, automation and web to lead forms.  

Anjali said...

I have been searching for a useful post like this on salesforce course details, it is highly helpful for me and I have a great experience with this Salesforce Training who are providing certification and job assistance. Salesforce training in Gurgaon

Nick569 said...

Great post! I am actually getting ready to across this information, It’s very helpful for this blog. Also great with all of the valuable information you have Keep up the good work you are doing well.
CRS Info Solutions Salesforce training for beginners