Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java JFormattedTextField的提示文本无效_Java_User Interface - Fatal编程技术网

Java JFormattedTextField的提示文本无效

Java JFormattedTextField的提示文本无效,java,user-interface,Java,User Interface,我想为我的JFormattedTextField添加一个文本提示,我在google上搜索了一下如何做到这一点。我在下面的代码中获得了很多点击率,但是当我在eclipse中将其放入代码中时,它无法识别任何一个。有人能告诉我为什么吗 以下是添加文本提示的两种可能方式: PromptSupport.setPrompt("prompt", textComponent); TextPrompt p = new TextPrompt("text", textComponent); 我是通过以下链接

我想为我的JFormattedTextField添加一个文本提示,我在google上搜索了一下如何做到这一点。我在下面的代码中获得了很多点击率,但是当我在eclipse中将其放入代码中时,它无法识别任何一个。有人能告诉我为什么吗

以下是添加文本提示的两种可能方式:

  PromptSupport.setPrompt("prompt", textComponent);
  TextPrompt p = new TextPrompt("text", textComponent);
我是通过以下链接得到的:

eclipse无法识别这些类的最可能原因是它们不是JDK的一部分

PromptSupport是库的一部分。如果您想使用这个库来设置PrompText,您必须下载jar并将其添加到项目的构建路径中

我不确定TextPrompt是否也是XSwingX类