Obtain a reference to the JLabel component and verify that the correct definition is there.
获得对JLabel组件的引用并检验是否显示了正确的释义。
For example the text of a JLabel or JTextField will be used as its default accessible name.
例如,JLabel或JTextField文本将被用作其缺省的可访问名称。
As I previously discussed, Swing compensates for this by allowing a JLabel to "label" the component.
正如我先前讨论的,这些Swing通过允许JLabel来标记组件以弥补这一不足。
To demonstrate, Listing 4 offers a JTextField component for input and a JLabel component for text display.
为了示范这一点,清单4提供了一个用于输入的JTextField组件和一个用于文本显示的JLabel组件。
Next, the Swing components (in this case a JLabel subclass that shows updating time) are created, as show in Listing 6.
接下来,创建Swing组件(在本例中是显示更新时间的jlabel子类),如清单6所示。
Then, if you try to add a JLabel to that collection, the compiler picks up the discrepancy and complains at compile time.
然后,如果想要将JLabel添加到集合,则编译器会在编译时发现差异和并抛出异常。
The second line of the error message says you are trying to add a JLabel to what the third error line is reporting as a List of JButton objects.
错误消息的第二行表明,您尝试将一个JLabel添加到第三个错误行报告的JButton对象的List。
The second line of the error message says you are trying to add a JLabel to what the third error line is reporting as a List of JButton objects.
错误消息的第二行表明,您尝试将一个JLabel添加到第三个错误行报告的JButton对象的List。
应用推荐