swing:text_fields

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
swing:text_fields [2018/03/27 16:54]
gthanos
swing:text_fields [2018/03/27 20:40]
gthanos [Η κλάση Document]
Line 106: Line 106:
 </code> </code>
  
-===== Document Listeners =====+===== Η κλάση Document =====
  
-Κάθε component ή κάθε κατηγορία component συνδέεται με κάποιο Listener InterfaceΤα παραπάνω text related components συνδέονται με το interface [[http://docs.oracle.com/javase/7/docs/api/javax/swing/event/DocumentListener.html|javax.swing.event.DocumentListener]]. Οι μέθοδοι του συγκεκριμένου interface δίνονται παρακάτω.+Τόσο τα **TextFields** όσο και τα **TextAreas** περιέχουν ένα αντικείμενο της κλάσης [[https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Document.html|Document]]. Η κλάση **Document** διαχειρίζεται το περιεχόμενο κείμενο όλων των κλάσεων αυτού του τύπου και μπορεί να σας επιστρέψει όλο ή μέρος από το περιεχόμενο του //component//. Ένα από τα βασικά χαρακτηριστικά του **Document** είναι ότι σε κάθε μεταβολή του περιεχομένου παράγει //events// του τύπου [[https://docs.oracle.com/javase/8/docs/api/javax/swing/event/DocumentEvent.html|DocumentEvent]], τα οποία μπορείτε να "πιάσετε" μέσω ενός αντικειμένου τύπου [[https://docs.oracle.com/javase/8/docs/api/javax/swing/event/DocumentListener.html|DocumentListener]] (//interface//). 
 + 
 +Οι μέθοδοι του interface [[http://docs.oracle.com/javase/7/docs/api/javax/swing/event/DocumentListener.html|javax.swing.event.DocumentListener]] δίνονται παρακάτω.
 <code java> <code java>
 +//Gives notification that an attribute or set of attributes changed.
 void changedUpdate(DocumentEvent e); void changedUpdate(DocumentEvent e);
-//Gives notification that an attribute or set of attributes changed. +//Gives notification that there was an insert into the document.
 void insertUpdate(DocumentEvent e); void insertUpdate(DocumentEvent e);
-//Gives notification that there was an insert into the document. +//Gives notification that a portion of the document has been removed.
 void removeUpdate(DocumentEvent e); void removeUpdate(DocumentEvent e);
-//Gives notification that a portion of the document has been removed. 
 </code> </code>
  
Line 278: Line 278:
 </code> </code>
  
 +| Προηγούμενο: [[:swing:buttons | Buttons, CheckBoxes & RadioButtons ]] | [[:toc | Περιεχόμενα ]] | Επόμενο: [[:swing:scrollpane | Η κλάση JScrollPane ]] |
  
swing/text_fields.txt · Last modified: 2018/03/27 19:40 (external edit)