Friday, July 12, 2013
Monday, July 1, 2013
Alternative colour for java jtable
jTblRefe = new javax.swing.JTable(){public Component prepareRenderer
(TableCellRenderer renderer,int Index_row, int Index_col)
{
Component comp = super.prepareRenderer(renderer, Index_row, Index_col);
//even index, selected or not selected
if (Index_row % 2 == 0 ) {
comp.setBackground(new java.awt.Color(230,212,212));
}
else
{
comp.setBackground(Color.white);
}
return comp;
}
public boolean isCellEditable(int row,int column){
return false;
};
}
;
(TableCellRenderer renderer,int Index_row, int Index_col)
{
Component comp = super.prepareRenderer(renderer, Index_row, Index_col);
//even index, selected or not selected
if (Index_row % 2 == 0 ) {
comp.setBackground(new java.awt.Color(230,212,212));
}
else
{
comp.setBackground(Color.white);
}
return comp;
}
public boolean isCellEditable(int row,int column){
return false;
};
}
;
Check java jar application is already running.
ServerSocket ss;
try {
ss = new ServerSocket(MY_PORT);
// not already running.
} catch (BindException e) {
// already running.
}
Steps.
1) open listning port.
2) check listning port alredy runnig.
Good luck.
Subscribe to:
Posts (Atom)