Java AWT Layouts

The java.awt library provides 5 basic layouts. Each layout has its own significance and all of them are completely different. Here in this article, we will discuss how to apply any layout to a frame or a panel and also discuss about each layout in brief. The 5 layouts available in the java.awt library are: …

Read more

Android TabLayout example

In this tutorial, we will demonstrates the use of TabLayout to render 4 tabs – “Android”, “Windows”, “Apple” and “BlackBerry”, each tab contains a textview to display a simple message. P.S This project is developed in Eclipse 3.7, and tested with Android 2.3.3. 1. Tab Images Put 4 tab images in “res/drawable” folder. The tab …

Read more

Android GridView example

In Android, GridView let you arranges components in a two-dimensional scrolling grid. For detail attribute exaplanation, see GridView reference. In this tutorial, we will show you 2 common GridView examples : Normal way, just display text in GridView layout. Create a custom adapter to display image and text in GridView layout. P.S This project is …

Read more

Android TableLayout example

In Android, TableLayout let you arranges components in rows and columns, just like the standard table layout in HTML, <tr> and <td>. In this tutorial, we show you how to use TableLayout to arrange button, textview and edittext in rows and columns format, and also demonstrates the use of “android:layout_span” to span view in 2 …

Read more

Android RelativeLayout example

In Android, RelativeLayout let you position your component base on the nearby (relative or sibling) component’s position. It’s the most flexible layout, that allow you to position your component to display in anywhere you want (if you know how to “relative” it). In RelativeLayout, you can use “above, below, left and right” to arrange the …

Read more

Android LinearLayout example

In Android, LinearLayout is a common layout that arranges “component” in vertical or horizontal order, via orientation attribute. In additional, the highest “weight” component will fill up the remaining space in LinearLayout. In this tutorial, we show you how to use LinearLayout to display 3 buttons in vertical and horizontal order, and also how “weight” …

Read more