Skip to main content

Posts

Showing posts with the label Software Development

How to add JCalendar/ date chooser to WindowBuilder, for Swing GUI in Java?

WindowBuilder is most popular eclipse plugin for drag and drop GUI design. It supports SWT and Swing. Swing does not have a date chooser component of its own. But there are many components available that you can use. My personal favourite is JCalendar . You can add JCalendar components to your WindowBuilder  palette  by following these instructions. Download and extract JCalendar.  Right-click on the palette   in WindowBuilder Select jar file of Jcalendar select all componetnts Restart Eclipse. Now you will see JCalendar components in your  palette . For more information about  visit this page.  

How to disable flash in FirefoxDriver/ FirefoxProfile / using java in Selenium?

For some tests using selenium automated testing with FirefoxDriver one can create a custom FirefoxProfile and disable flash in it. Here is the code I used for this.                 FirefoxProfile profile= new FirefoxProfile(); profile.setPreference("plugin.state.flash", 0); FirefoxDriver driver = new                                       FirefoxDriver(profile);

How to parse HTML/ extract data from HTML / using Java?

Java has a large set of APIs to parse HTML. To extract data from HTML  and perform any manipulation we should be able to parse it. jsoup provides a very easy to use , powerful and compact API to pare HTML and extract data. It supports DOM, CSS and jquery like selectors. It is designed for all types of HTML and will even parse HTML which is not perfectly valid. Example In this example we fetch BBC Sport , parse it to DOM and then select headlines using css-selector. Document doc = soup.connect(" http://www.bbc.co.uk/sport/0/ ").get();  Elements newsHeadlines = doc.select("#more-news-headlines li"); We can also provide HTML directly in a string.  A detailed documentation is available at jsoup website. You may start from official cook book available here . 

Building Android Applications

With the introduction of more power and capabilities, now mobile devices can do tasks that were considered impossible in past. Market for mobile applications is hot at the moment. There are different platforms used in different mobile devices, and each requires different ways and tools to develop applications. But once you have got a useful application you should be able to port it to different platforms. Most important thing you need is a useful idea and some programming skills.  Android is a  popular operating systems for mobile devices. Android is a software stack for mobile devices that includes an operating system, middleware and key applications.  Android provides an SDK  to develop applications for  Android  using Java Programming Language. There are many options available for development environments. You can use  The Android Development Tools (ADT) plugin for Eclipse to add powerful extensions to the Eclips...