JTextField类(单行文本框)/JPasswordFiel(密码框)/JTextArea(多行文本框)常用方法
生活随笔
收集整理的這篇文章主要介紹了
JTextField类(单行文本框)/JPasswordFiel(密码框)/JTextArea(多行文本框)常用方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
JTextField類常用方法(單行文本框)
JTextField() ? ? ? ? ?構造 ? ? ? ? ? ? 構造一個默認的文本框
JTextField(String text) 構造 構造一個指定文本內容的文本框
setColumns(int colums) ? ? 普通 ? 設置顯示長度
?
JPasswordField類常用方法(密碼框)
JPasswordField() ? ? ? ? ? ? ? ? ?構造 構造默認的JPasswordField對象
JPasswordField(String text) 構造 構造指定內容的JPasswordField對象
setEchoChar(char c) ? ? 構造 設置回顯的字符,默認為'*'
getEchoChar() ? ? ? 構造 ? ? 得到回顯的字符
char[]getPassword() ? 構造 ? ? ? ? ? ? ? ? ? 得到文本框的所有內容
?
?
JTextArea類常用方法(多行文本框)
JTextArea() ?構造 ? ? ? 構造文本域,行數和列數為0
JTextArea(int rows,int columns) 構造 ? ? 構造文本域,指定行數和列數
JTextArea(String text,int rows,int columns) ? 構造 ? ? 指定文本域的內容、行數和列數
append(String str) ? 普通 ? ? ? ?在文本域中追加內容
replaceRange(String str,int start,int end) 普通 ? 替換文本域中指定范圍的內容
insert(String str,int pos) 普通 ? ? 在指定位置插入文本
setLineWrap(boolean wrap) 普通 ? 設置換行策略
轉載于:https://www.cnblogs.com/l666/p/9206598.html
總結
以上是生活随笔為你收集整理的JTextField类(单行文本框)/JPasswordFiel(密码框)/JTextArea(多行文本框)常用方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Jenkins 基础入门
- 下一篇: ES6常用知识总结(20%的知识占80%