Links
Recent blog posts
Links
CcR's blog
How do add a checkbox to items in a JList?
Tue, 06/08/2010 - 21:56 — CcRimport java.awt.Component;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JScrollPane;
import javax.swing.ListCellRenderer;
import javax.swing.ListSelectionModel;
public class CheckListExample
{
public static void main(String args[])
{
JFrame Jframe = new JFrame();
Jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Create a list containing CheckBoxItem's
JList jlist = new JList(new CheckBoxItem[] {
Persistence with Java SE an example
Thu, 01/21/2010 - 19:38 — CcR1. Create a Entity Class {Employee.java}
import javax.persistence.Entity;
import javax.persistence.Id;
@Entity // Make Employee Class into an entity by annotate the class with @Entity.
public class Employee {
@Id private int id; //property that holds the persistent identity of the entity (the primary key).
private String name;
private long salary;
public Employee() {}
public Employee(int id) { this.id = id; }
public int getId() { return id; }
public void setId(int id) { this.id = id; }
Linux command Reference
Sat, 12/12/2009 - 01:21 — CcR| Command | Description | |
| • | apropos whatis | Show commands pertinent to string. |
| • | man -t man | ps2pdf - > man.pdf | make a pdf of a manual page |