Posts

Showing posts from 2013

PDF/Excel sheet writing through JAVA

Image
Hi, Today I am going to explain the writing of PDF and Excel sheet through java.   To write the data from java to PDF file you may require the following supporting jars, jText-2.1.5.jar gnujaxp.jar jcommon-1.0.17.jar    I use the netbean IDE for the development where I added the above jars on the project library for download above jar's click here Here I create the JFileChooser to select the destination where we want to save a file Create a function which will ask you to select the file type for saving or exporting data to pdf or excel sheet public JFileChooser file_select  public void Select_fileType()  {     try         {                     file_select  =new JFileChooser();          file_select.setFileSelectionMode(JFileChooser.FILES_ONLY);          file_select.setFileFilter(new FileTypeFilter(".pdf", "PDF Document"));          file_select.setFileFilter(new FileTypeFilter(".xls", "Excel Document"))

JTable Connection with JDBC-MYSQL and Pagination Over JTable

Image
Today I show you how to use the JTable and pagination over the JTable for the data representation on the java swing. JTable is the java swing component which show the data on tabular format on the two-dimensional tables of cells. public class Jtable extends JComponent implements TableModelListener , Scrollable , TableColumnModelListener ,    ListSelectionListener , CellEditorListener , Accessible , RowSorterListener   JTable display large data at a time but it take some time to load the data so for that I have used the pagination over the table and the records are displayed on the number of pages. I used the netbean IDE 7.0.1 for the UI development I create the Jtable , and stored the data from the mysql DB. And paging the data... DefaultTableModel Tbl_Model; DefaultListModel Tbl_List; ResultSetMetaData metaDt_first; private javax.swing.JTable tbl_result; Statement st_bookingTable; ResultSet