art*_*ros 0 java inheritance implementation interface
我有一点问题.
第ll类:
interface jj{
public class ll implements gg{
public static String j ="C:\\";
//some code here
}
}
Run Code Online (Sandbox Code Playgroud)
班级ggg:
interface gg{
public class ggg extends JFrame implements jj{
//bunch of code + a textfield
textField = new JTextField();
textField.setBounds(72, 120, 217, 20);
textField.setColumns(10);
//bunch of code
}
}
Run Code Online (Sandbox Code Playgroud)
CLass aaa
public class aaa implements jj, gg {
public aaa(){
//File chooser here + editing strin "j" from class "ll"
File f = chooser.getSelectedFile();
if(f!=null)
{
jj.ll.j = f.getPath();
//And printing "j" string to the text field from ggg class
gg.ggg.textField.setText(jj.ll.j);
}
}
}
Run Code Online (Sandbox Code Playgroud)
我的问题是,文本字段打印不起作用.我尝试使用System.out.println jj.ll.j字符串来测试它是否有东西.是的,它有和预期的工作方式.