我有一个 Swing-GUI(使用 Netbeans GUI-Builder 构建),有一个标签,我可以使用箭头键四处移动。按下空格键调用另一个类。如何从此类访问标签并获得职位?
提前感谢您的帮助!第二类的示例代码:
public class Xy extends Thread {
private Window s; // this is the jFrame-form
public Xy(Window s) {
this.s = s;
s.setBackground(Color.yellow); // works
}
public void run() {
// here i want to use the position of a label which is located on the form s
}