Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.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
Swing 是否将JTextArea添加到JMapViewer?_Swing_Jmapviewer - Fatal编程技术网

Swing 是否将JTextArea添加到JMapViewer?

Swing 是否将JTextArea添加到JMapViewer?,swing,jmapviewer,Swing,Jmapviewer,我们可以将JTextArea添加到JMapViewer吗?差不多 JMapViewer map() = new JMapViewer(); map.add(new JTextArea(10,10)); 另一个解决方法是将其添加到JFrame/JInternalFrame中的GridBagLayout中,但我想知道是否可以在地图中显示文本?尝试时发生了什么;-)就像你做textArea.setText(“Wie-Gehts?”)一样,它只显示一个灰色屏幕,里面没有文本。

我们可以将JTextArea添加到JMapViewer吗?差不多

JMapViewer map() = new JMapViewer();
map.add(new JTextArea(10,10));

另一个解决方法是将其添加到JFrame/JInternalFrame中的GridBagLayout中,但我想知道是否可以在地图中显示文本?

尝试时发生了什么;-)就像你做textArea.setText(“Wie-Gehts?”)一样,它只显示一个灰色屏幕,里面没有文本。