ITEXT PDF / NOTES</>↗iText PDF27 Dec 2008
This example shows how to create a table in a PDF document. Using the iText PDF library we can use the PdfPTable and the PdfPCell classes to create table and cells in our PDF document. In the following example we use array of strings to define the table’s data. Let’s see the complete code snippet […]
SWING / NOTES</>↗Swing27 Dec 2008
This example demonstrate how to add an items into a specific position in the combo box list or at the end of the list using the insertItemAt(Object o, int index) and addItem(Object o) method. In the code we also learn how to remove one or all items from the list using removeItemAt(int index) method and […]
SWING / NOTES</>↗Swing23 Dec 2008
This example demonstrate the use of JComboBox‘s getItemCount() method and getItemAt(int index) to get the number of items inside the combo box and how to obtain each of them. package org.kodejava.swing; import javax.swing.*; import java.awt.*; public class ComboBoxGetItems extends JFrame { public ComboBoxGetItems() { initialize(); } public static void main(String[] args) { SwingUtilities.invokeLater(() -> new […]
SWING / NOTES</>↗Swing19 Dec 2008
The code below demonstrate how to set the selected item of JComboBox and then on how to get the value of the selected item. In this example we set the JComboBox component so that user can enter their own value. package org.kodejava.swing; import javax.swing.*; import java.awt.*; public class ComboBoxSelectedItem extends JFrame { public ComboBoxSelectedItem() { […]
SWING / NOTES</>↗Swing17 Dec 2008
A JComboBox allows user to select a value from a drop-down items available in the component. When the combo box set to editable user can enter their own value by typing it directly in the combo box editor. The code below demonstrate how you can create a simple combo box component. package org.kodejava.swing; import javax.swing.*; […]
APACHE POI / NOTES</>↗Apache POI15 Dec 2008
This example demonstrate how to use HSSFCellStyle and HSSFFont to format the cell style in Excel document. Using this class we can define cell border, foreground and background color. We can also define the font we used to display the cell value. package org.kodejava.poi; import org.apache.poi.hssf.usermodel.*; import org.apache.poi.hssf.util.HSSFColor; import org.apache.poi.ss.usermodel.BorderStyle; import org.apache.poi.ss.usermodel.FillPatternType; import java.io.FileOutpu...