C'è un modo per far passare un java.awt.Font?Strike through java.awt.Font
risposta
Quindi ho trovato questo, che funziona.
Font font = new Font("helvetica", Font.PLAIN, 12);
Map attributes = font.getAttributes();
attributes.put(TextAttribute.STRIKETHROUGH, TextAttribute.STRIKETHROUGH_ON);
Font newFont = new Font(attributes);
esempi di sottolineatura e barrato in awt.
http://www.java2s.com/Code/Java/2D-Graphics-GUI/TextAttributeUnderlineandstrikethrough.htm
In sostanza, creare un nuovo AttributedString fuori della stringa, aggiungere un attributo barrato, e disegnare.
NOTA: questo NON renderà il barrato FONT, ma è possibile impostare il testo su quel carattere e quindi barrare il testo. Questo è semplicemente un altro modo di farlo. La risposta di Rich rende effettivamente il carattere barrato.
Nel caso in cui si sono interessati a quello che altri attributi di testo sono disponibili è possibile utilizzare il Visual Font Designer di sperimentare con differenti attributi per vedere come appaiono. Il progettista ti consente anche di cambiare il carattere in modo da poter verificare se il colpo è disponibile per il carattere che desideri utilizzare.
- 1. Firebug CSS strike-through
- 2. Carattere strike-through nell'obiettivo C
- 3. Strike-through in e-mail in formato HTML
- 4. rails has_many: through has_many: through
- 5. Font.createFont (..) imposta il colore e la dimensione (java.awt.Font)
- 6. Rails polymorphic has_many: through
- 7. Iterate through DataSet
- 8. C#: Cycle through encodings
- 9. loop through JPanel
- 10. activerecord find through association
- 11. Iterating through viewgroup
- 12. Django M2MFields 'through' widgets
- 13. Python 'except' fall-through
- 14. loop through sottocartelle
- 15. Has_Many: Through o: finder_sql
- 16. Iterate through 2 Lists
- 17. jQuery loop through json?
- 18. Cycle Through Divs
- 19. NSTextField click-through?
- 20. Iterating through array - java
- 21. C++ Loop through Map
- 22. utilizzando has_many: through e build
- 23. Prevenire il click through div
- 24. Ecto has_many: through in form
- 25. loop through celle nell'intervallo denominato
- 26. ConvertFrom-JSON Loop Through oggetto
- 27. Write-back vs Write-through
- 28. Rails act_as_paranoid e has_many: through
- 29. Iterating Through N Level Children
- 30. jQuery loop through data() oggetto
Funzionerà per tutti i tipi di carattere? Non riuscivo a capirlo. – AlbertoPL
Grazie @richs funziona con me –