martes, 15 de marzo de 2011

Agregar una impresora en Open Suse 11.3

Vas a Aplicaciones - Utilidades - Administración de impresoras.

Tablilla Administración.

Añadir impresora.

Elegis
Protocolo de Impresión de Internet IPP (ipp)

Escribis esto
http://192.168.4.50:631/ipp/


La IP vendria a ser la ip de tu impresora y listo

lunes, 7 de marzo de 2011

Evento ENTER en JTable

Un evento que me gusta mucho para el rápido acceso.




table.addKeyListener(new KeyListener() {


@Override
public void keyTyped(KeyEvent arg0) {
}


@Override
public void keyReleased(KeyEvent arg0) {
}


@Override
public void keyPressed(KeyEvent arg0) {
int key = arg0.getKeyCode();
if (key == KeyEvent.VK_ENTER) {
modificarCliente();
} else {
if (key == KeyEvent.VK_CONTROL){
try {
conectarMostrar("Select * From Cliente", "", "");
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
}
System.out.println("no");
}
}
});

Setear el cursor en un Jtext en java



To the top
myJTextArea.setCaretPosition(0);


To the end
myJTextArea.setCaretPosition(myJTextArea.getDocument().getLength());


Setear en el jtext el cursor
myJTextArea.requestFocus();