本文整理了Java中javax.swing.JTextArea.hasFocus()
方法的一些代码示例,展示了JTextArea.hasFocus()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextArea.hasFocus()
方法的具体详情如下:
包路径:javax.swing.JTextArea
类名称:JTextArea
方法名:hasFocus
暂无
代码示例来源:origin: stackoverflow.com
JTextArea area = new JTextArea();
Color c = Color.CYAN;
if(area.hasFocus())
{
area.setBackground(c);
}
代码示例来源:origin: JGillam/burp-co2
private void showPrompt() {
if (cwd.equals(".")) {
txtConsole.append("laudanum> ");
} else {
txtConsole.append("laudanum[" + cwd + "]> ");
}
txtConsole.setCaretPosition(txtConsole.getText().length());
commandStart = txtConsole.getCaretPosition();
if (!txtConsole.hasFocus()) {
txtConsole.grabFocus();
}
}
代码示例来源:origin: stackoverflow.com
public void actionPerformed(ActionEvent e) {
System.out.println("Clicked");
if (left.hasFocus()) {
right.requestFocusInWindow();
} else if (right.hasFocus()) {
left.requestFocusInWindow();
代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-ui
if (isSourceWindowActive() || jtpSource.hasFocus()) {
jtpFindSource = (JTextComponent) jtpSource;
} else {
代码示例来源:origin: com.google.code.findbugs/findbugs
protected void commentBoxClicked() {
if (commentWasChanged()) {
return;
}
setCanAddComments(false, true);
CommentInfo commentInfo = new CommentInfo().invoke();
boolean sameText = commentInfo.isSameText();
String txt = commentInfo.getTxt();
if (!sameText) {
txt = "";
}
if (txt == null || txt.trim().length() == 0) {
txt = "";
}
resetCommentBoxFont();
boolean sameTextInBox = commentBox.getText().equals(txt);
setCommentText(txt);
int start = commentBox.getSelectionStart();
int end = commentBox.getSelectionEnd();
if (!commentBox.hasFocus() && (!sameTextInBox || start != 0 || end != txt.length())) {
commentBox.setSelectionStart(0);
commentBox.setSelectionEnd(txt.length());
}
updateSaveButton();
}
代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-ui
writeOutBase64(jtpSource.getText());
} else if (command.equals("textcut")) {
if (jspSource.isShowing() && jtpSource.hasFocus()) {
jtpSource.cut();
} else {
if (jspSource.isShowing() && jtpSource.hasFocus()) {
jtpSource.copy();
} else {
if (jspSource.isShowing() && jtpSource.hasFocus()) {
jtpSource.paste();
} else {
代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-ui
boolean bReplaceAll = false;
JTextComponent searchPane = (JTextComponent) jtpMain;
if (jspSource.isShowing() || jtpSource.hasFocus()) {
searchPane = (JTextComponent) jtpSource;
内容来源于网络,如有侵权,请联系作者删除!