private void addActions(){
final VokabelnBackend b = this.ba;
// Weitersuchen
this.tabvok.addKeyListener(new KeyListener() {
@Override
public void keyTyped(KeyEvent e) {
//throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void keyPressed(KeyEvent e) {
//throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void keyReleased(KeyEvent e) {
if(e.getKeyCode() == KeyEvent.VK_F3){
searchInTable();
}
//throw new UnsupportedOperationException("Not supported yet.");
}
});
// Datumauswahl
startStamp.getDateEditor().addPropertyChangeListener(new PropertyChangeListener(){
@Override
public void propertyChange(PropertyChangeEvent evt){
if(evt.getPropertyName().equals("date")){
SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy");
Date da;
try{
da = sdf.parse(sdf.format(evt.getNewValue()));
System.out.println(""+(da.getTime()/1000));
showVokabeln((da.getTime()/1000), (endStamp.getDate().getTime()/1000));
}catch(ParseException npe){
System.out.println("DEBUG :: Unknown Error in Line 337 in Vokabeln.java :: "+npe);
}
startStamp.setMaxSelectableDate(endStamp.getDate());
startStamp.updateUI();
endStamp.setMinSelectableDate(startStamp.getDate());
endStamp.updateUI();
category = false;
}
}
});
endStamp.getDateEditor().addPropertyChangeListener(new PropertyChangeListener(){
@Override
public void propertyChange(PropertyChangeEvent evt){
if(evt.getPropertyName().equals("date")){
SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy");
Date da;
try{
da = sdf.parse(sdf.format(evt.getNewValue()));
System.out.println(""+(da.getTime()/1000));
showVokabeln((startStamp.getDate().getTime()/1000), (da.getTime()/1000));
}catch(ParseException npe){
System.out.println("DEBUG :: Unknown Error in Line 360 in Vokabeln.java :: "+npe);
}
startStamp.setMaxSelectableDate(endStamp.getDate());
startStamp.updateUI();
endStamp.setMinSelectableDate(startStamp.getDate());
endStamp.updateUI();
category = false;
}
}
});
// Suchfeld
this.searchField.addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent e) {
searchField.setSelectionStart(0);
searchField.setSelectionEnd(searchField.toString().length());
}
@Override
public void focusLost(FocusEvent e) {
//throw new UnsupportedOperationException("Not supported yet.");
}
});
this.searchField.addKeyListener(new KeyListener() {
@Override
public void keyTyped(KeyEvent e) {
//throw new UnsupportedOperationException("Not supported yet.");
}